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

void org::kbinani::cadencii::FormMain::handleDragDrop ( IconDynamicsHandle  handle,
int  screen_x,
int  screen_y 
) [inline]

ピアノロールにドロップされたIconDynamicsHandleの受け入れ処理を行います

Definition at line 10297 of file FormMain.cs.

References org::kbinani::cadencii::AppManager::clockFromXCoord(), org::kbinani::vsq::VsqEvent::clone(), org::kbinani::vsq::VsqTrack::clone(), org::kbinani::cadencii::AppManager::editHistory, org::kbinani::cadencii::AppManager::getPositionQuantizeClock(), org::kbinani::vsq::VsqFile::getPreMeasureClocks(), org::kbinani::cadencii::AppManager::getSelected(), org::kbinani::cadencii::AppManager::getVsqFile(), org::kbinani::cadencii::AppManager::mAddingEvent, org::kbinani::cadencii::AppManager::noteFromYCoord(), org::kbinani::vsq::VsqTrack::reflectDynamics(), org::kbinani::cadencii::EditHistoryModel::register(), org::kbinani::cadencii::AppManager::setEditMode(), and org::kbinani::vsq::VsqFile::Track.

        {
            if( handle == null ){
                return;
            }
            Point locPianoroll = pictPianoRoll.getLocationOnScreen();
            // ドロップ位置を特定して,アイテムを追加する
            int x = screen_x - locPianoroll.x;
            int y = screen_y - locPianoroll.y;
            int clock1 = AppManager.clockFromXCoord( x );

            // クオンタイズの処理
            int unit = AppManager.getPositionQuantizeClock();
            int clock = doQuantize( clock1, unit );

            int note = AppManager.noteFromYCoord( y );
            VsqFileEx vsq = AppManager.getVsqFile();
            int clockAtPremeasure = vsq.getPreMeasureClocks();
            if ( clock < clockAtPremeasure ) {
                return;
            }
            if ( note < 0 || 128 < note ) {
                return;
            }

            int selected = AppManager.getSelected();
            VsqTrack vsq_track = vsq.Track.get( selected );
            VsqTrack work = (VsqTrack)vsq_track.clone();

            if ( AppManager.mAddingEvent == null ) {
                // ここは多分起こらない
                return;
            }
            VsqEvent item = (VsqEvent)AppManager.mAddingEvent.clone();
            item.Clock = clock;
            item.ID.Note = note;
            work.addEvent( item );
            work.reflectDynamics();
            CadenciiCommand run = VsqFileEx.generateCommandTrackReplace( selected, work, vsq.AttachedCurves.get( selected - 1 ) );
            AppManager.editHistory.register( vsq.executeCommand( run ) );
            setEdited( true );
            AppManager.setEditMode( EditMode.NONE );
            refreshScreen();
        }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index