Logo Search packages:      
Sourcecode: cadencii version File versions  Download package

void org::kbinani::cadencii::FormMain::selectForward (  ) [inline]

現在選択されている音符よりも1個後方の音符を選択しなおします。

Definition at line 2267 of file FormMain.cs.

References org::kbinani::cadencii::SelectedEventEntry::editing, org::kbinani::cadencii::AppManager::getCurrentClock(), org::kbinani::cadencii::AppManager::getSelected(), org::kbinani::cadencii::AppManager::getVsqFile(), org::kbinani::vsq::VsqEvent::InternalID, org::kbinani::cadencii::AppManager::itemSelection, org::kbinani::cadencii::SelectedEventEntry::original, and org::kbinani::vsq::VsqFile::Track.

        {
            int count = AppManager.itemSelection.getEventCount();
            if ( count <= 0 ) {
                return;
            }
            VsqFileEx vsq = AppManager.getVsqFile();
            if ( vsq == null ) {
                return;
            }
            int selected = AppManager.getSelected();
            VsqTrack vsq_track = vsq.Track.get( selected );

            // 選択されている音符のうち、最も後方にあるものがどれかを調べる
            int max_clock = int.MinValue;
            int internal_id = -1;
            VsqIDType type = VsqIDType.Unknown;
            for ( Iterator<SelectedEventEntry> itr = AppManager.itemSelection.getEventIterator(); itr.hasNext(); ) {
                SelectedEventEntry item = itr.next();
                if ( max_clock <= item.editing.Clock ) {
                    max_clock = item.editing.Clock;
                    internal_id = item.original.InternalID;
                    type = item.original.ID.type;
                }
            }
            if ( internal_id == -1 || type == VsqIDType.Unknown ) {
                return;
            }

            // 1個後ろのアイテムのIDを検索
            int last_id = -1;
            int clock = AppManager.getCurrentClock();
            boolean break_next = false;
            for ( Iterator<VsqEvent> itr = vsq_track.getEventIterator(); itr.hasNext(); ) {
                VsqEvent item = itr.next();
                if ( item.ID.type != type ) {
                    continue;
                }
                if ( item.InternalID == internal_id ) {
                    break_next = true;
                    last_id = item.InternalID;
                    clock = item.Clock;
                    continue;
                }
                last_id = item.InternalID;
                clock = item.Clock;
                if ( break_next ) {
                    break;
                }
            }
            if ( last_id == -1 ) {
                return;
            }

            // 選択しなおす
            AppManager.itemSelection.clearEvent();
            AppManager.itemSelection.addEvent( last_id );
            ensureVisible( clock );
        }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index