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

void org::kbinani::cadencii::FormMain::lengthenSelectedEvent ( int  delta_length ) [inline, private]

選択された音符の長さを、指定したゲートタイム分長くします。

Parameters:
delta_length

Definition at line 1665 of file FormMain.cs.

References org::kbinani::vsq::VsqEvent::clone(), org::kbinani::cadencii::SelectedEventEntry::editing, org::kbinani::cadencii::Utility::editLengthOfVsqEvent(), org::kbinani::cadencii::AppManager::getSelected(), org::kbinani::cadencii::AppManager::getVsqFile(), org::kbinani::vsq::IconDynamicsHandle::isCrescendType(), org::kbinani::vsq::IconDynamicsHandle::isDecrescendType(), org::kbinani::cadencii::AppManager::itemSelection, and org::kbinani::cadencii::AppManager::vibratoLengthEditingRule.

        {
            if ( delta_length == 0 ) {
                return;
            }

            VsqFileEx vsq = AppManager.getVsqFile();
            if ( vsq == null ) {
                return;
            }

            int selected = AppManager.getSelected();

            Vector<VsqEvent> items = new Vector<VsqEvent>();
            for ( Iterator<SelectedEventEntry> itr = AppManager.itemSelection.getEventIterator(); itr.hasNext(); ) {
                SelectedEventEntry item = itr.next();
                if ( item.editing.ID.type != VsqIDType.Anote &&
                     item.editing.ID.type != VsqIDType.Aicon ) {
                    continue;
                }

                // クレッシェンド、デクレッシェンドでないものを省く
                if ( item.editing.ID.type == VsqIDType.Aicon ) {
                    if ( item.editing.ID.IconDynamicsHandle == null ) {
                        continue;
                    }
                    if ( !item.editing.ID.IconDynamicsHandle.isCrescendType() &&
                         !item.editing.ID.IconDynamicsHandle.isDecrescendType() ) {
                        continue;
                    }
                }

                // 長さを変える。0未満になると0に直す
                int length = item.editing.ID.getLength();
                int draft = length + delta_length;
                if ( draft < 0 ) {
                    draft = 0;
                }
                if ( length == draft ) {
                    continue;
                }

                // ビブラートの長さを変更
                VsqEvent add = (VsqEvent)item.editing.clone();
                Utility.editLengthOfVsqEvent( add, draft, AppManager.vibratoLengthEditingRule );
                items.add( add );
            }

            if ( items.size() <= 0 ) {
                return;
            }

            // コマンドを発行
            CadenciiCommand run = new CadenciiCommand(
                VsqCommand.generateCommandEventReplaceRange(
                    selected, items.toArray( new VsqEvent[] { } ) ) );
            AppManager.editHistory.register( vsq.executeCommand( run ) );

            // 編集されたものを再選択する
            for ( Iterator<VsqEvent> itr = items.iterator(); itr.hasNext(); ) {
                VsqEvent item = itr.next();
                AppManager.itemSelection.addEvent( item.InternalID );
            }

            // 編集が施された。
            setEdited( true );
            updateDrawObjectList();

            refreshScreen();
        }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index