Changeset 1179 for trunk


Ignore:
Timestamp:
10/02/18 10:18:57 (6 years ago)
Author:
bln4
Message:

org.apollo.ApolloGestureActions ->
org.apollo.widgets.SampledTrack ->

Reimplemented the ability to stamp SampledTracks

Location:
trunk/src/org/apollo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/apollo/ApolloGestureActions.java

    r1158 r1179  
    3737import org.expeditee.items.Text;
    3838import org.expeditee.items.UserAppliedPermission;
     39import org.expeditee.items.widgets.InteractiveWidgetInitialisationFailedException;
     40import org.expeditee.items.widgets.InteractiveWidgetNotAvailableException;
    3941import org.expeditee.items.widgets.Widget;
    4042import org.expeditee.items.widgets.WidgetCorner;
     
    101103
    102104        private void setGestureAction(GestureType type, GestureAction action) {
    103                 if (type == null)
     105                if (type == null) {
    104106                        return;
     107                }
    105108
    106109                _actions.put(type, action);
     
    108111
    109112        private GestureAction getGestureAction(GestureType type) {
    110                 if (type == null)
     113                if (type == null) {
    111114                        return null;
     115                }
    112116
    113117                return _actions.get(type);
     
    131135                                }
    132136
    133                                 if (selectedIW != null)
     137                                if (selectedIW != null) {
    134138                                        adjustInitiationTime(selectedIW, data.getAdjustment());
     139                                }
    135140                        }
    136141                });
     
    152157                                }
    153158
    154                                 if (selectedIW != null)
     159                                if (selectedIW != null) {
    155160                                        adjustVerticalPosition(selectedIW, data.getAdjustment());
     161                                }
    156162                        }
    157163                });
     
    205211                                       
    206212                                        final List<SampledTrack> sampledTracks = new LinkedList<SampledTrack>();
    207                        
    208213                       
    209214                                        @Override
     
    226231                                        public void exec(final Gesture gesture) {
    227232                                                final PickUpGestureData data = (PickUpGestureData) gesture.getData();
     233                                                final List<Item> widgetPieces = new LinkedList<Item>();
    228234                                                if (data.getCopy()) {
    229                                                 }
    230                                                 anchorTracks();
     235                                                        sampledTracks.forEach(st -> {
     236                                                                st.getItems().forEach(i -> {
     237                                                                        StandardGestureActions.anchor(i);
     238                                                                        widgetPieces.add(i);
     239                                                                });
     240                                                        });
     241                                                        FreeItems.getInstance().clear();
     242                                                        anchorTracks(widgetPieces);
     243                                                        final List<Item> toPickup = new LinkedList<Item>();
     244                                                        sampledTracks.forEach(st -> {
     245                                                                try {
     246                                                                        final Widget copy = st.copy();
     247                                                                        toPickup.addAll(copy.getItems());
     248                                                                } catch (InteractiveWidgetNotAvailableException e) {
     249                                                                        e.printStackTrace();
     250                                                                } catch (InteractiveWidgetInitialisationFailedException e) {
     251                                                                        e.printStackTrace();
     252                                                                }
     253                                                        });
     254                                                        StandardGestureActions.pickup(toPickup);
     255                                                } else {
     256                                                        anchorTracks(FreeItems.getInstance());
     257                                                }
    231258                                        }
    232259                                       
     
    252279        /** Gets the gesture type associated with the given standard type. */
    253280        public GestureType gestureType(ApolloGestureType type) {
    254                 if (type == null)
     281                if (type == null) {
    255282                        return null;
     283                }
    256284
    257285                return _gestureTypes.get(type);
     
    277305        public static void adjustInitiationTime(SampledTrack track, long adjustment) {
    278306                Mutable.Long oldIt = track.getInitiationTimeFromMeta();
    279                 if (oldIt == null)
     307                if (oldIt == null) {
    280308                        oldIt = Mutable.createMutableLong(0);
     309                }
    281310                track.setInitiationTime(oldIt.value + adjustment);
    282311        }
     
    284313        public static void adjustInitiationTime(LinkedTrack track, long adjustment) {
    285314                Mutable.Long oldIt = track.getInitiationTimeFromMeta();
    286                 if (oldIt == null)
     315                if (oldIt == null) {
    287316                        oldIt = Mutable.createMutableLong(0);
     317                }
    288318                track.setInitiationTime(oldIt.value + adjustment);
    289319        }
     
    318348                                // Get enclosing shape and enclosed tracks
    319349                                for (Item ip : enclosedItems) {
    320                                         if (ip.getParent() != current)
     350                                        if (ip.getParent() != current) {
    321351                                                continue;
     352                                        }
    322353
    323354                                        if (ip.hasPermission(UserAppliedPermission.full)) {
     
    399430                                        // Creat the link to contain all tracks
    400431                                        String name = current.getTitle();
    401                                         if (name == null)
     432                                        if (name == null) {
    402433                                                name = "Unnamed";
     434                                        }
    403435                                        name += " group";
    404436
     
    458490
    459491                        for (Item i : FreeItems.getInstance()) {
    460                                 if (i.getY() < smallestY)
     492                                if (i.getY() < smallestY) {
    461493                                        smallestY = i.getY();
     494                                }
    462495                        }
    463496
     
    519552                                int smallestY = FreeItems.getInstance().get(0).getY();
    520553                                for (Item i : FreeItems.getInstance()) {
    521                                         if (i.getX() < smallestX)
     554                                        if (i.getX() < smallestX) {
    522555                                                smallestX = i.getX();
    523                                         if (i.getY() < smallestY)
     556                                        }
     557                                        if (i.getY() < smallestY) {
    524558                                                smallestY = i.getY();
     559                                        }
    525560                                }
    526561
     
    530565                                        int y;
    531566
    532                                         if (closestXDistance > 0 && closestXDistance < COARSE_X_PLACEMENT_TOLERANCE)
     567                                        if (closestXDistance > 0 && closestXDistance < COARSE_X_PLACEMENT_TOLERANCE) {
    533568                                                x = closestXPosition + (i.getX() - smallestX);
    534                                         else
     569                                        } else {
    535570                                                x = to.getX() + (i.getX() - smallestX);
    536 
    537                                         if (closestYDistance > 0 && closestYDistance < COARSE_Y_PLACEMENT_TOLERANCE)
     571                                        }
     572
     573                                        if (closestYDistance > 0 && closestYDistance < COARSE_Y_PLACEMENT_TOLERANCE) {
    538574                                                y = closestYPosition + (i.getY() - smallestY);
    539                                         else
     575                                        } else {
    540576                                                y = to.getY() + (i.getY() - smallestY);
     577                                        }
    541578
    542579                                        i.setPosition(x, y);
     
    574611        }
    575612
    576         public void anchorTracks() {
     613        private void anchorTracks(final List<Item> widgetPieces) {
    577614
    578615                // Widget -> delta IT time
     
    580617                Map<SampledTrack, Mutable.Long> anchoredTracks = null;
    581618
    582                 if (FreeItems.getInstance().size() > 1) {
    583                         List<Widget> anchoringWidgets = ItemUtils.extractWidgets(FreeItems.getInstance());
     619//              if (FreeItems.getInstance().size() > 1) {
     620                if (widgetPieces.size() > 1) {
     621//                      List<Widget> anchoringWidgets = ItemUtils.extractWidgets(FreeItems.getInstance());
     622                        List<Widget> anchoringWidgets = ItemUtils.extractWidgets(widgetPieces);
    584623
    585624                        Mutable.Long firstInitTime = null;
     
    595634                                        LinkedTrack lt = (LinkedTrack) iw;
    596635                                        it = lt.getInitiationTimeFromMeta();
    597                                         if (it == null)
     636                                        if (it == null) {
    598637                                                it = Mutable.createMutableLong(0);
     638                                        }
    599639
    600640                                        anchoredLinkedTracks.put(lt, it);
     
    604644                                        SampledTrack st = (SampledTrack) iw;
    605645                                        it = st.getInitiationTimeFromMeta();
    606                                         if (it == null)
     646                                        if (it == null) {
    607647                                                it = Mutable.createMutableLong(0);
     648                                        }
    608649
    609650                                        anchoredTracks.put(st, it);
    610651
    611                                 } else
     652                                } else {
    612653                                        continue;
     654                                }
    613655
    614656                                if (firstInitTime == null) {
     
    641683
    642684                }
    643 
     685               
    644686                // If anchored a group of tracks .. adjust initiation times to
    645687                if (anchoredLinkedTracks != null) {
     
    667709                        for (LinkedTrack lt : anchoredLinkedTracks.keySet()) {
    668710                                Mutable.Long it = anchoredLinkedTracks.get(lt);
    669                                 if (it.value == 0)
     711                                if (it.value == 0) {
    670712                                        continue;
     713                                }
    671714                                lt.setInitiationTime(firstInitTime.value + it.value);
    672715                        }
     
    674717                        for (SampledTrack st : anchoredTracks.keySet()) {
    675718                                Mutable.Long it = anchoredTracks.get(st);
    676                                 if (it.value == 0)
     719                                if (it.value == 0) {
    677720                                        continue;
     721                                }
    678722                                st.setInitiationTime(firstInitTime.value + it.value);
    679723                        }
  • trunk/src/org/apollo/widgets/SampledTrack.java

    r1156 r1179  
    159159
    160160                // Create the immutable mix subject
    161                 if (mixTemplate == null)
     161                if (mixTemplate == null) {
    162162                        trackMix = SoundDesk.getInstance().getOrCreateMix(SoundDesk.createPureLocalChannelID(this));
    163                
    164                 else trackMix = SoundDesk.getInstance().createMix(
    165                                 SoundDesk.createPureLocalChannelID(this),
    166                                 mixTemplate.getVolume(),
    167                                 mixTemplate.isMuted());
     163                } else {
     164                        trackMix = SoundDesk.getInstance().createMix(
     165                                        SoundDesk.createPureLocalChannelID(this),
     166                                        mixTemplate.getVolume(),
     167                                        mixTemplate.isMuted());
     168                }
    168169                               
    169170                // Keep meta as constant as possible for best results
     
    275276                fulltrackView.addMouseMotionListener(new MouseMotionListener() {
    276277
     278                        @Override
    277279                        public void mouseDragged(MouseEvent e) {
    278280                                if (nameLabel != null) {
     
    283285                        }
    284286
     287                        @Override
    285288                        public void mouseMoved(MouseEvent e) {
    286289
     
    331334                fulltrackView.addMouseListener(new MouseListener() {
    332335
     336                        @Override
    333337                        public void mouseClicked(MouseEvent e) {
    334                                 if (trackModel == null) return;
     338                                if (trackModel == null) {
     339                                        return;
     340                                }
    335341                               
    336342                                if (nameLabel != null) {
     
    349355                        }
    350356
     357                        @Override
    351358                        public void mouseEntered(MouseEvent e) {
    352359                        }
    353360
     361                        @Override
    354362                        public void mouseExited(MouseEvent e) {
    355363                        }
    356364
     365                        @Override
    357366                        public void mousePressed(MouseEvent e) {
    358367                                if (nameLabel != null) {
     
    370379                        }
    371380
     381                        @Override
    372382                        public void mouseReleased(MouseEvent e) {
    373383                                if (nameLabel != null) {
     
    378388                               
    379389                                 if (!e.isConsumed() && e.getButton() == MouseEvent.BUTTON2) {
    380                                                 if (split(true))
     390                                                if (split(true)) {
    381391                                                        e.consume();
     392                                                }
    382393                                        }
    383394                               
     
    393404                fulltrackView.addKeyListener(new KeyListener() {
    394405
     406                        @Override
    395407                        public void keyPressed(KeyEvent e)
    396408                        {
    397409                        }
    398410
     411                        @Override
    399412                        public void keyReleased(KeyEvent e)
    400413                        {
     
    408421                                else if (!e.isControlDown() && e.getKeyCode() == KeyEvent.VK_DELETE) {
    409422                                       
    410                                         if (split(false))  // try Perform delete-split
     423                                        if (split(false)) {
    411424                                                e.consume();
     425                                        }
    412426                                       
    413427                                }
     
    420434                                               
    421435                                                String name =  getName();
    422                                                 if (name == null) name = "Unamed";
     436                                                if (name == null) {
     437                                                        name = "Unamed";
     438                                                }
    423439                                               
    424440                                                Mutable.Long initTime = getInitiationTimeFromMeta();
    425                                                 if (initTime == null) initTime = Mutable.createMutableLong(0);
     441                                                if (initTime == null) {
     442                                                        initTime = Mutable.createMutableLong(0);
     443                                                }
    426444                                               
    427445                                                Text linkSource = new Text(current.getNextItemID());
     
    433451                                                // Save any changes in the audio - or save for the first time
    434452                                                if (trackModel.isAudioModified())
     453                                                 {
    435454                                                        saveWidgetData(); // a little lag is OK .. could make smarter if really need to
     455                                                }
    436456                                               
    437457                                                // Create a new frame to hold the track
     
    477497                        }
    478498
     499                        @Override
    479500                        public void keyTyped(KeyEvent e) {
    480501                        }
     
    486507               
    487508                String metaName = getStrippedDataString(TrackWidgetCommons.META_NAME_TAG);
    488                 if (metaName == null) metaName = "Untitled";
     509                if (metaName == null) {
     510                        metaName = "Untitled";
     511                }
    489512                nameLabel.setText(metaName);
    490513
    491514                nameLabel.addTextChangeListener(new TextChangeListener() { //  a little bit loopy!
    492515
     516                        @Override
    493517                        public void onTextChanged(Object source, String newLabel) {
    494518                                if (trackModel != null && !nameLabel.getText().equals(trackModel.getName())) {
     
    558582                int width = -1;
    559583                if (tl != null) {
    560                         width = (int)((double)runningtime / tl.getTimePerPixel());
     584                        width = (int)(runningtime / tl.getTimePerPixel());
    561585                }       
    562586               
    563587                // Clamp width to something reasonable.
    564                 if (width > 0 && width < FrameLayoutDaemon.MIN_TRACK_WIDGET_WIDTH) width = FrameLayoutDaemon.MIN_TRACK_WIDGET_WIDTH;
     588                if (width > 0 && width < FrameLayoutDaemon.MIN_TRACK_WIDGET_WIDTH) {
     589                        width = FrameLayoutDaemon.MIN_TRACK_WIDGET_WIDTH;
     590                }
    565591
    566592                long initTime = (tl == null) ? 0 : tl.getMSTimeAtX(x);
     
    573599                data.add(TrackWidgetCommons.META_INITIATIONTIME_TAG + initTime);
    574600                data.add(TrackWidgetCommons.META_LAST_WIDTH_TAG + width); // although layout manager will handle, just to quick set
    575                 if (name != null) data.add(TrackWidgetCommons.META_NAME_TAG + name);
     601                if (name != null) {
     602                        data.add(TrackWidgetCommons.META_NAME_TAG + name);
     603                }
    576604               
    577605                source.setData(data);
     
    644672                data.add(META_LOCALNAME_TAG + localFileName);
    645673               
    646                 if (shouldOmitAudioIndexing) data.add(META_DONT_INDEX_AUDIO_TAG);
     674                if (shouldOmitAudioIndexing) {
     675                        data.add(META_DONT_INDEX_AUDIO_TAG);
     676                }
    647677               
    648678                String lastName = getName();
    649679               
    650                 if (lastName != null)
     680                if (lastName != null) {
    651681                        data.add(TrackWidgetCommons.META_NAME_TAG + lastName);
     682                }
    652683               
    653684                data.add(TrackWidgetCommons.META_LAST_WIDTH_TAG + getWidth());
     
    663694                }
    664695               
    665                 if (initTime == null) initTime = getInitiationTimeFromMeta(); // old meta
    666                 if (initTime == null) initTime = Mutable.createMutableLong(0L);
     696                if (initTime == null)
     697                 {
     698                        initTime = getInitiationTimeFromMeta(); // old meta
     699                }
     700                if (initTime == null) {
     701                        initTime = Mutable.createMutableLong(0L);
     702                }
    667703
    668704                data.add(TrackWidgetCommons.META_INITIATIONTIME_TAG + initTime);
     
    677713        public Widget copy()
    678714                throws InteractiveWidgetNotAvailableException, InteractiveWidgetInitialisationFailedException {
    679                
    680715                if (trackModel == null) {
    681716                        return super.copy();
    682717                       
    683718                } else {
    684 
    685719                        return SampledTrack.createFromMemory(
    686720                                        trackModel.getAllAudioBytesCopy(),
     
    711745                        setLoadScreenMessage("Recovering audio file...");
    712746                       
    713                         if (recoveryFile.exists())
     747                        if (recoveryFile.exists()) {
    714748                                f = recoveryFile;
     749                        }
    715750
    716751                }
     
    735770                       
    736771                        // Nullify
    737                         if (!f.exists() || !f.isFile()) f = null;
     772                        if (!f.exists() || !f.isFile()) {
     773                                f = null;
     774                        }
    738775
    739776                }
     
    799836                // Set the name for this track
    800837                String name = getStrippedDataString(TrackWidgetCommons.META_NAME_TAG);
    801                 if (name != null)
     838                if (name != null) {
    802839                        trackModel.setName(name);
     840                }
    803841               
    804842                initObservers(); // sets default name if non set
     
    817855                        SwingUtilities.invokeAndWait(new Runnable() {
    818856                               
     857                                @Override
    819858                                public void run() {
    820859                                       
     
    859898         * Used by save manager
    860899         */
     900        @Override
    861901        public boolean doesNeedSaving() {
    862902                return (trackModel != null && (trackModel.isAudioModified() || trackModel.getFilepath() == null));
     
    866906         * Used by save manager
    867907         */
     908        @Override
    868909        public String getSaveName() {
    869910               
    870                 if (trackModel != null && trackModel.getName() != null)
     911                if (trackModel != null && trackModel.getName() != null) {
    871912                        return "Sampled Track: " + trackModel.getName();
    872                 else return "A Sampled Track";
     913                } else {
     914                        return "A Sampled Track";
     915                }
    873916               
    874917        }
     
    890933        protected void saveWidgetData() {
    891934               
    892                 if (trackModel == null) return; // nothing to save
     935                if (trackModel == null)
     936                 {
     937                        return; // nothing to save
     938                }
    893939               
    894940                // If saving for the file time then get a filename
     
    920966                        try {
    921967                                SwingUtilities.invokeAndWait(new Runnable() {
     968                                        @Override
    922969                                        public void run() {
    923970                                                releaseMemory(true);
     
    947994                // Still needs to save?
    948995                if (doesNeedSaving() || trackModel == null)
     996                 {
    949997                        return; // Release memory later when saved
     998                }
    950999
    9511000                try {
    9521001                        // Release memory - on swing thread to avoid nullified model data wil painting / editing.
    9531002                        SwingUtilities.invokeAndWait(new Runnable() {
     1003                                @Override
    9541004                                public void run() {
    9551005                                        releaseMemory(true);
     
    9691019
    9701020                // Need unloading?
    971                 if (trackModel == null) return;
     1021                if (trackModel == null) {
     1022                        return;
     1023                }
    9721024               
    9731025                // Get rid of old temporary files
     
    10191071                        // Release memory - on swing thread to avoid nullified model data wil painting / editing.
    10201072                        SwingUtilities.invokeAndWait(new Runnable() {
     1073                                @Override
    10211074                                public void run() {
    10221075                                        releaseMemory(false);
     
    10601113         * Global Track model re-use ....
    10611114         */
     1115        @Override
    10621116        public SampledTrackModel getSharedSampledTrackModel(String localfilename) {
    10631117                if (trackModel != null &&
     
    11091163        }
    11101164
     1165        @Override
    11111166        public void onGraphDirty(SampledTrackGraphView graph, Rectangle dirty)
    11121167        {
     
    11161171        }
    11171172
     1173        @Override
    11181174        public Subject getObservedSubject() {
    11191175                return null;
     
    11321188         * Responds to model changed events by updating the GUI ...
    11331189         */
     1190        @Override
    11341191        public void modelChanged(Subject source, SubjectChangedEvent event) {
    11351192               
     
    11641221                                        } else {
    11651222                                                float perc = ((Float)event.getState()).floatValue();
    1166                                                 if (perc > 1.0f) perc = 1.0f;
     1223                                                if (perc > 1.0f) {
     1224                                                        perc = 1.0f;
     1225                                                }
    11671226                                                perc *= FILE_LOADING_PERCENT_RANGE; // Dont stretch load to all of bar - still will have more work to do
    11681227                                                updateLoadPercentage(perc);
     
    12131272                                       
    12141273                                                Mutable.Long inittime = getInitiationTimeFromMeta();
    1215                                                 if (inittime == null) inittime = Mutable.createMutableLong(0);
     1274                                                if (inittime == null) {
     1275                                                        inittime = Mutable.createMutableLong(0);
     1276                                                }
    12161277                                                inittime.value += (oldRunningTime - newRunningTime);
    12171278                                               
     
    12331294        }
    12341295       
     1296        @Override
    12351297        public void setObservedSubject(Subject parent) {
    12361298        }
     
    13181380                        // Draw the name
    13191381                        String name = getName();
    1320                         if (name == null) name = "Unnamed";
     1382                        if (name == null) {
     1383                                name = "Unnamed";
     1384                        }
    13211385
    13221386                        g.setFont(SwingMiscManager.getIfUsingSwingFontManager().getInternalFont(TrackWidgetCommons.FREESPACE_TRACKNAME_FONT));
     
    14191483                                                inferInitTime &= (eventType == ItemParentStateChangedEvent.EVENT_TYPE_ADDED);
    14201484                                               
    1421                                                 if (inferInitTime)
     1485                                                if (inferInitTime) {
    14221486                                                        initTime = Mutable.createMutableLong(FrameLayoutDaemon.getInstance().getMSAtX(getX(), parent));
     1487                                                }
    14231488                                        }
    14241489
     
    15491614                // Cannot inject into EditableSampledTrackGraphView's while playing, although
    15501615                // won't break anything, this would be confusing for the user.
    1551                 if (target.isPlaying()) return;
     1616                if (target.isPlaying()) {
     1617                        return;
     1618                }
    15521619               
    15531620                // Inject the audio at the graph poistion
     
    15631630                // more references to this item therefore the memory will be freed
    15641631                // eventually after this invoke
    1565                 if (destroySelf) removeSelf();
     1632                if (destroySelf) {
     1633                        removeSelf();
     1634                }
    15661635        }
    15671636       
     
    16061675         *              The name given to this widget... can be null.
    16071676         */
     1677        @Override
    16081678        public String getName() {
    1609                 if (this.trackModel != null)
     1679                if (this.trackModel != null) {
    16101680                        return trackModel.getName();
    1611                 else if (this.nameLabel != null) {
     1681                } else if (this.nameLabel != null) {
    16121682                        return nameLabel.getText();
    16131683                }
     
    16241694        public Mutable.Long getInitiationTimeFromMeta() {
    16251695                Long l = getStrippedDataLong(TrackWidgetCommons.META_INITIATIONTIME_TAG, null);
    1626                 if (l != null) return Mutable.createMutableLong(l.longValue());
     1696                if (l != null) {
     1697                        return Mutable.createMutableLong(l.longValue());
     1698                }
    16271699                return null;
    16281700        }
     
    16631735        public void setYPosition(int newY) {
    16641736
    1665                 if (getY() == newY || isFloating()) return;
     1737                if (getY() == newY || isFloating()) {
     1738                        return;
     1739                }
    16661740
    16671741                Frame parent = getParentFrame();
    16681742               
    16691743                Mutable.Long initTime = getInitiationTimeFromMeta();
    1670                 if (initTime == null) return;
     1744                if (initTime == null) {
     1745                        return;
     1746                }
    16711747               
    16721748                setPosition(getX(), newY);
     
    17711847                                // Build the new neighbouring widget
    17721848                                Frame target = getParentFrame();
    1773                                 if (target == null) target = DisplayController.getCurrentFrame();
     1849                                if (target == null) {
     1850                                        target = DisplayController.getCurrentFrame();
     1851                                }
    17741852                               
    17751853                                // Determine init time
    17761854                                Mutable.Long initTime = getInitiationTimeFromMeta();
    17771855                               
    1778                                 if (initTime == null) initTime = Mutable.createMutableLong(0);
     1856                                if (initTime == null) {
     1857                                        initTime = Mutable.createMutableLong(0);
     1858                                }
    17791859                               
    17801860                                initTime.value += AudioMath.framesToMilliseconds(rightSideStartFrame, trackModel.getFormat());
     
    18291909                Frame parent = getParentFrame();
    18301910                String pfname = (parent != null) ?  parent.getName() : null;
    1831                 if (pfname == null) return;
     1911                if (pfname == null) {
     1912                        return;
     1913                }
    18321914
    18331915                if (!ExpandedTrackManager.getInstance().isTrackInExpansionSelection(trackModel)) {
     
    19131995                }
    19141996
     1997                @Override
    19151998                public void actionPerformed(ActionEvent e) {
    1916                         if (trackModel == null) return;
     1999                        if (trackModel == null) {
     2000                                return;
     2001                        }
    19172002                       
    19182003                        if (e.getSource() == playPauseButton) {
     
    20122097                }
    20132098               
     2099                @Override
    20142100                public Subject getObservedSubject()
    20152101                {
     
    20172103                }
    20182104
     2105                @Override
    20192106                public void setObservedSubject(Subject parent)
    20202107                {
     
    20242111                 * Receives events from the track model OR from the observed track sequence.
    20252112                 */
     2113                @Override
    20262114                public void modelChanged(Subject source, SubjectChangedEvent event)
    20272115                {
     
    21092197                protected void volumeChanged()
    21102198                {
    2111                         trackMix.setVolume(((float)volumeSlider.getValue()) / 100.0f);
     2199                        trackMix.setVolume((volumeSlider.getValue()) / 100.0f);
    21122200                }
    21132201
Note: See TracChangeset for help on using the changeset viewer.