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

void org::kbinani::cadencii::TrackSelector::paint ( Graphics  graphics ) [inline]

コントロール画面を描画します

Parameters:
graphics

Reimplemented from org::kbinani::windows::forms::BPanel.

Definition at line 1171 of file TrackSelector.cs.

References org::kbinani::cadencii::CurveType::Accent, org::kbinani::cadencii::LineGraphDrawer::append(), org::kbinani::cadencii::AppManager::baseFont10Bold, org::kbinani::cadencii::AppManager::baseFont8, org::kbinani::cadencii::AppManager::baseFont8Height, org::kbinani::cadencii::AppManager::baseFont8OffsetHeight, org::kbinani::cadencii::AppManager::baseFont9, org::kbinani::cadencii::AppManager::baseFont9Height, org::kbinani::cadencii::AppManager::baseFont9OffsetHeight, org::kbinani::cadencii::LineGraphDrawer::clear(), org::kbinani::cadencii::AppManager::clockFromXCoord(), org::kbinani::cadencii::AppManager::COLOR_BORDER, org::kbinani::cadencii::CurveType::Decay, org::kbinani::cadencii::LineGraphDrawer::DOTMODE_NO, org::kbinani::cadencii::SelectedEventEntry::editing, org::kbinani::cadencii::LineGraphDrawer::flush(), org::kbinani::vsq::VsqFile::getBarLineIterator(), org::kbinani::vsq::VsqTrack::getCommon(), org::kbinani::cadencii::AppManager::getCurrentClock(), org::kbinani::vsq::VsqTrack::getCurve(), org::kbinani::cadencii::AppManager::getPositionQuantizeClock(), org::kbinani::vsq::VsqFile::getPreMeasure(), org::kbinani::vsq::VsqFile::getPreMeasureClocks(), org::kbinani::cadencii::AppManager::getSelected(), org::kbinani::cadencii::AppManager::getSelectedTool(), org::kbinani::vsq::VsqTrack::getSingerEventAt(), org::kbinani::cadencii::FormMainController::getStartToDrawX(), org::kbinani::cadencii::AppManager::getVsqFile(), org::kbinani::cadencii::AppManager::HILIGHT, org::kbinani::vsq::IconHandle::IDS, org::kbinani::vsq::VsqEvent::InternalID, org::kbinani::cadencii::AppManager::isCurveMode(), org::kbinani::cadencii::AppManager::isGridVisible(), org::kbinani::cadencii::AppManager::itemSelection, org::kbinani::cadencii::AppManager::keyOffset, org::kbinani::cadencii::AppManager::keyWidth, org::kbinani::cadencii::AppManager::mCurveSelectedInterval, org::kbinani::cadencii::AppManager::mCurveSelectingRectangle, org::kbinani::cadencii::AppManager::mDrawIsUtau, org::kbinani::cadencii::AppManager::mMainWindowController, org::kbinani::cadencii::AppManager::mWholeSelectedInterval, org::kbinani::vsq::VsqMetaText::PBS, org::kbinani::vsq::VsqCommon::PlayMode, org::kbinani::cadencii::AppManager::RENDER, org::kbinani::cadencii::LineGraphDrawer::setBaseLineY(), org::kbinani::cadencii::LineGraphDrawer::setDotMode(), org::kbinani::cadencii::LineGraphDrawer::setDrawLine(), org::kbinani::cadencii::LineGraphDrawer::setFill(), org::kbinani::cadencii::LineGraphDrawer::setFillColor(), org::kbinani::vsq::VsqFile::Track, org::kbinani::cadencii::CurveType::VEL, org::kbinani::cadencii::CurveType::VibratoDepth, org::kbinani::cadencii::CurveType::VibratoRate, and org::kbinani::cadencii::AppManager::xCoordFromClocks().

        {
#if JAVA
            super.paint( graphics );
#endif
            int width = getWidth();
            int height = getHeight();
            int graph_height = getGraphHeight();
            Dimension size = new Dimension( width + 2, height );
            Graphics2D g = (Graphics2D)graphics;
            Color brs_string = Color.black;
            Color rect_curve = new Color( 41, 46, 55 );
            int centre = HEADER + graph_height / 2;
            g.setColor( PortUtil.DarkGray );
            g.fillRect( 0, size.height - 2 * OFFSET_TRACK_TAB, size.width, 2 * OFFSET_TRACK_TAB );
            int numeric_view = mMouseValue;
            Point p = pointToClient( PortUtil.getMousePosition() );
            Point mouse = new Point( p.x, p.y );
            VsqFileEx vsq = AppManager.getVsqFile();
            int selected = AppManager.getSelected();
            int key_width = AppManager.keyWidth;
            int stdx = AppManager.mMainWindowController.getStartToDrawX();
            int graph_max_y = HEADER + graph_height;
            int graph_min_y = HEADER;

            try {
                #region SINGER
                Shape last = g.getClip();
                g.setColor( AppManager.COLOR_BORDER );
                g.drawLine( 0, size.height - 2 * OFFSET_TRACK_TAB,
                            size.width - 0, size.height - 2 * OFFSET_TRACK_TAB );
                g.setFont( AppManager.baseFont8 );
                g.setColor( brs_string );
                g.drawString(
                    "SINGER",
                    9,
                    size.height - 2 * OFFSET_TRACK_TAB + OFFSET_TRACK_TAB / 2 - AppManager.baseFont8OffsetHeight );
                g.clipRect( key_width, size.height - 2 * OFFSET_TRACK_TAB,
                            size.width - key_width, OFFSET_TRACK_TAB );
                VsqTrack vsq_track = null;
                if ( vsq != null ) {
                    vsq_track = vsq.Track.get( selected );
                }
                if ( vsq_track != null ) {
                    int ycoord = size.height - 2 * OFFSET_TRACK_TAB + 1;

                    // 左端での歌手を最初に描画
                    int x_at_left = AppManager.keyWidth + AppManager.keyOffset;
                    int clock_at_left = AppManager.clockFromXCoord( x_at_left );
                    VsqEvent singer_at_left = vsq_track.getSingerEventAt( clock_at_left );
                    if ( singer_at_left != null ) {
                        Rectangle rc =
                            new Rectangle( x_at_left, ycoord,
                                           SINGER_ITEM_WIDTH, OFFSET_TRACK_TAB - 2 );
                        g.setColor( Color.lightGray );
                        g.fillRect( rc.x, rc.y, rc.width, rc.height );
                        g.setColor( COLOR_SINGERBOX_BORDER );
                        g.drawRect( rc.x, rc.y, rc.width, rc.height );
                        g.setColor( brs_string );
                        g.drawString(
                            singer_at_left.ID.IconHandle.IDS,
                            rc.x, rc.y + OFFSET_TRACK_TAB / 2 - AppManager.baseFont8OffsetHeight );
                    }

                    // 歌手設定を順に描画
                    int event_count = vsq_track.getEventCount();
                    for ( int i = 0; i < event_count; i++ ) {
                        VsqEvent ve = vsq_track.getEvent( i );
                        if ( ve.ID.type != VsqIDType.Singer ) {
                            continue;
                        }
                        int clock = ve.Clock;
                        IconHandle singer_handle = (IconHandle)ve.ID.IconHandle;
                        int x = AppManager.xCoordFromClocks( clock );
                        if ( x < x_at_left ) {
                            continue;
                        }
                        Rectangle rc =
                            new Rectangle( x, ycoord,
                                           SINGER_ITEM_WIDTH, OFFSET_TRACK_TAB - 2 );
                        if ( AppManager.itemSelection.isEventContains( selected, ve.InternalID ) ) {
                            g.setColor( AppManager.getHilightColor() );
                        } else {
                            g.setColor( Color.white );
                        }
                        g.fillRect( rc.x, rc.y, rc.width, rc.height );
                        g.setColor( COLOR_SINGERBOX_BORDER );
                        g.drawRect( rc.x, rc.y, rc.width, rc.height );
                        g.setColor( brs_string );
                        g.drawString(
                            singer_handle.IDS,
                            rc.x, rc.y + OFFSET_TRACK_TAB / 2 - AppManager.baseFont8OffsetHeight );
                    }
                }
                g.setClip( last );
                #endregion

                #region トラック選択欄
                int selecter_width = getSelectorWidth();
                g.setColor( AppManager.COLOR_BORDER );
                g.drawLine( 0, size.height - OFFSET_TRACK_TAB,
                            size.width, size.height - OFFSET_TRACK_TAB );
                g.setColor( brs_string );
                g.drawString( "TRACK", 9, size.height - OFFSET_TRACK_TAB + OFFSET_TRACK_TAB / 2 - AppManager.baseFont8OffsetHeight );
                if ( vsq != null ) {
                    for ( int i = 0; i < 16; i++ ) {
                        int x = key_width + i * selecter_width;
#if DEBUG
                        try {
#endif
                            drawTrackTab( g,
                                          new Rectangle( x, size.height - OFFSET_TRACK_TAB + 1, selecter_width, OFFSET_TRACK_TAB - 1 ),
                                          (i + 1 < vsq.Track.size()) ? (i + 1) + " " + vsq.Track.get( i + 1 ).getName() : "",
                                          (i == selected - 1),
                                          vsq_track.getCommon().PlayMode >= 0,
                                          AppManager.getRenderRequired( i + 1 ),
                                          AppManager.HILIGHT[i],
                                          AppManager.RENDER[i] );
#if DEBUG
                        } catch ( Exception ex ) {
                            AppManager.debugWriteLine( "TrackSelector.DrawTo; ex=" + ex );
                        }
#endif
                    }
                }
                #endregion

                int clock_at_mouse = AppManager.clockFromXCoord( mouse.x );
                int pbs_at_mouse = 0;
                if ( mCurveVisible ) {
                    #region カーブエディタ
                    // カーブエディタの下の線
                    g.setColor( new Color( 156, 161, 169 ) );
                    g.drawLine( key_width, size.height - 42,
                                size.width - 3, size.height - 42 );

                    // カーブエディタの上の線
                    g.setColor( new Color( 46, 47, 50 ) );
                    g.drawLine( key_width, HEADER,
                                size.width - 3, HEADER );

                    g.setColor( new Color( 125, 123, 124 ) );
                    g.drawLine( key_width, 0,
                                key_width, size.height - 1 );

                    if ( AppManager.isCurveSelectedIntervalEnabled() ) {
                        int x0 = AppManager.xCoordFromClocks( AppManager.mCurveSelectedInterval.getStart() );
                        int x1 = AppManager.xCoordFromClocks( AppManager.mCurveSelectedInterval.getEnd() );
                        g.setColor( COLOR_A072R255G255B255 );
                        g.fillRect( x0, HEADER, x1 - x0, graph_height );
                    }

                    #region 小節ごとのライン
                    if ( vsq != null ) {
                        int dashed_line_step = AppManager.getPositionQuantizeClock();
                        g.clipRect( key_width, HEADER, size.width - key_width, size.height - 2 * OFFSET_TRACK_TAB );
                        Color white100 = new Color( 0, 0, 0, 100 );
                        for ( Iterator<VsqBarLineType> itr = vsq.getBarLineIterator( AppManager.clockFromXCoord( width ) ); itr.hasNext(); ) {
                            VsqBarLineType blt = itr.next();
                            int x = AppManager.xCoordFromClocks( blt.clock() );
                            int local_clock_step = 480 * 4 / blt.getLocalDenominator();
                            if ( blt.isSeparator() ) {
                                g.setColor( white100 );
                                g.drawLine( x, size.height - 42 - 1, x, 8 + 1 );
                            } else {
                                g.setColor( white100 );
                                g.drawLine( x, centre - 5, x, centre + 6 );
                                Color pen = new Color( 12, 12, 12 );
                                g.setColor( pen );
                                g.drawLine( x, 8, x, 14 );
                                g.drawLine( x, size.height - 43, x, size.height - 42 - 6 );
                            }
                            if ( dashed_line_step > 1 && AppManager.isGridVisible() ) {
                                int numDashedLine = local_clock_step / dashed_line_step;
                                Color pen = new Color( 65, 65, 65 );
                                g.setColor( pen );
                                for ( int i = 1; i < numDashedLine; i++ ) {
                                    int x2 = AppManager.xCoordFromClocks( blt.clock() + i * dashed_line_step );
                                    g.drawLine( x2, centre - 2, x2, centre + 3 );
                                    g.drawLine( x2, 8, x2, 12 );
                                    g.drawLine( x2, size.height - 43, x2, size.height - 43 - 4 );
                                }
                            }
                        }
                        g.setClip( null );
                    }
                    #endregion

                    if ( vsq_track != null ) {
                        Color color = AppManager.getHilightColor();
                        Color front = new Color( color.getRed(), color.getGreen(), color.getBlue(), 150 );
                        Color back = new Color( 255, 249, 255, 44 );
                        Color vel_color = new Color( 64, 78, 30 );

                        // 後ろに描くカーブ
                        if ( mLastSelectedCurve.equals( CurveType.VEL ) || mLastSelectedCurve.equals( CurveType.Accent ) || mLastSelectedCurve.equals( CurveType.Decay ) ) {
                            drawVEL( g, vsq_track, back, false, mLastSelectedCurve );
                        } else if ( mLastSelectedCurve.equals( CurveType.VibratoRate ) || mLastSelectedCurve.equals( CurveType.VibratoDepth ) ) {
                            drawVibratoControlCurve( g, vsq_track, mLastSelectedCurve, back, false );
                        } else {
                            VsqBPList list_back = vsq_track.getCurve( mLastSelectedCurve.getName() );
                            if ( list_back != null ) {
                                drawVsqBPList( g, list_back, back, false );
                            }
                        }

                        // 手前に描くカーブ
                        if ( mSelectedCurve.equals( CurveType.VEL ) || mSelectedCurve.equals( CurveType.Accent ) || mSelectedCurve.equals( CurveType.Decay ) ) {
                            drawVEL( g, vsq_track, vel_color, true, mSelectedCurve );
                        } else if ( mSelectedCurve.equals( CurveType.VibratoRate ) || mSelectedCurve.equals( CurveType.VibratoDepth ) ) {
                            drawVibratoControlCurve( g, vsq_track, mSelectedCurve, front, true );
                        } else if ( mSelectedCurve.equals( CurveType.Env ) ) {
                            drawEnvelope( g, selected, front );
                        } else {
                            VsqBPList list_front = vsq_track.getCurve( mSelectedCurve.getName() );
                            if ( list_front != null ) {
                                drawVsqBPList( g, list_front, front, true );
                            }
                            if ( mSelectedCurve.equals( CurveType.PIT ) ) {
                                #region PBSの値に応じて,メモリを記入する
#if !JAVA
                                System.Drawing.Drawing2D.SmoothingMode old = g.nativeGraphics.SmoothingMode;
                                g.nativeGraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
#endif
                                Color nrml = new Color( 0, 0, 0, 190 );
                                Color dash = new Color( 0, 0, 0, 128 );
                                Stroke nrml_stroke = new BasicStroke();
                                Stroke dash_stroke = new BasicStroke( 1.0f, 0, 0, 10.0f, new float[] { 2.0f, 2.0f }, 0.0f );
                                VsqBPList pbs = vsq_track.MetaText.PBS;
                                pbs_at_mouse = pbs.getValue( clock_at_mouse );
                                int c = pbs.size();
                                int premeasure = vsq.getPreMeasureClocks();
                                int clock_start = AppManager.clockFromXCoord( key_width );
                                int clock_end = AppManager.clockFromXCoord( width );
                                if ( clock_start < premeasure && premeasure < clock_end ) {
                                    clock_start = premeasure;
                                }
                                int last_pbs = pbs.getValue( clock_start );
                                int last_clock = clock_start;
                                int ycenter = yCoordFromValue( 0 );
                                g.setColor( nrml );
                                g.drawLine( key_width, ycenter, width, ycenter );
                                for ( int i = 0; i < c; i++ ) {
                                    int cl = pbs.getKeyClock( i );
                                    if ( cl < clock_start ) {
                                        continue;
                                    }
                                    if ( clock_end < cl ) {
                                        break;
                                    }
                                    int thispbs = pbs.getElement( i );
                                    if ( last_pbs == thispbs ) {
                                        continue;
                                    }
                                    // last_clockからclの範囲で,PBSの値がlas_pbs
                                    int max = last_pbs;
                                    int min = -last_pbs;
                                    int x1 = AppManager.xCoordFromClocks( last_clock );
                                    int x2 = AppManager.xCoordFromClocks( cl );
                                    for ( int j = min + 1; j <= max - 1; j++ ) {
                                        if ( j == 0 ) {
                                            continue;
                                        }
                                        int y = yCoordFromValue( (int)(j * 8192 / (double)last_pbs) );
                                        if ( j % 2 == 0 ) {
                                            g.setColor( nrml );
                                            g.setStroke( nrml_stroke );
                                            g.drawLine( x1, y, x2, y );
                                        } else {
                                            g.setColor( dash );
                                            g.setStroke( dash_stroke );
                                            g.drawLine( x1, y, x2, y );
                                        }
                                    }
                                    g.setStroke( new BasicStroke() );
                                    last_clock = cl;
                                    last_pbs = thispbs;
                                }
                                int max0 = last_pbs;
                                int min0 = -last_pbs;
                                int x10 = AppManager.xCoordFromClocks( last_clock );
                                int x20 = AppManager.xCoordFromClocks( clock_end );
                                for ( int j = min0 + 1; j <= max0 - 1; j++ ) {
                                    if ( j == 0 ) {
                                        continue;
                                    }
                                    int y = yCoordFromValue( (int)(j * 8192 / (double)last_pbs) );
                                    Color pen = dash;
                                    if ( j % 2 == 0 ) {
                                        pen = nrml;
                                    }
                                    g.setColor( pen );
                                    g.drawLine( x10, y, x20, y );
                                }
#if !JAVA
                                g.nativeGraphics.SmoothingMode = old;
#endif
                                #endregion
                            }
                            drawAttachedCurve( g, vsq.AttachedCurves.get( AppManager.getSelected() - 1 ).get( mSelectedCurve ) );
                        }
                    }

                    if ( AppManager.isWholeSelectedIntervalEnabled() ) {
                        int start = AppManager.xCoordFromClocks( AppManager.mWholeSelectedInterval.getStart() ) + 2;
                        int end = AppManager.xCoordFromClocks( AppManager.mWholeSelectedInterval.getEnd() ) + 2;
                        g.setColor( COLOR_A098R000G000B000 );
                        g.fillRect( start, HEADER, end - start, graph_height );
                    }

                    if ( mMouseDowned ) {
                        #region 選択されたツールに応じて描画
                        int value = valueFromYCoord( mouse.y );
                        if ( clock_at_mouse < vsq.getPreMeasure() ) {
                            clock_at_mouse = vsq.getPreMeasure();
                        }
                        int max = mSelectedCurve.getMaximum();
                        int min = mSelectedCurve.getMinimum();
                        if ( value < min ) {
                            value = min;
                        } else if ( max < value ) {
                            value = max;
                        }
                        EditTool tool = AppManager.getSelectedTool();
                        if ( tool == EditTool.LINE ) {
#if OLD_IMPL_MOUSE_TRACER
                            int xini = AppManager.xCoordFromClocks( m_line_start.x );
                            int yini = yCoordFromValue( m_line_start.y );
                            g.setColor( s_pen_050_140_150 );
                            g.drawLine( xini, yini, AppManager.xCoordFromClocks( clock_at_mouse ), yCoordFromValue( value ) );
#else
                            if ( mMouseTracer.size() > 0 ) {
                                Point pt = mMouseTracer.iterator().next();
                                int xini = pt.x - stdx;
                                int yini = pt.y;
                                g.setColor( Color.ORANGE );
                                g.setStroke( getStroke2px() );
#if !JAVA
                                g.nativeGraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
#endif
                                g.drawLine( xini, yini, AppManager.xCoordFromClocks( clock_at_mouse ), yCoordFromValue( value ) );
#if !JAVA
                                g.nativeGraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
#endif
                                g.setStroke( getStrokeDefault() );
                            }
#endif
                        } else if ( tool == EditTool.PENCIL ) {
                            if ( mMouseTracer.size() > 0 && !AppManager.isCurveMode() ) {
                                LineGraphDrawer d = getGraphDrawer();
                                d.clear();
                                d.setGraphics( g );
                                d.setBaseLineY( graph_max_y );
                                d.setFill( true );
                                d.setDotMode( LineGraphDrawer.DOTMODE_NO );
                                d.setDrawLine( false );
                                d.setFillColor( COLOR_MOUSE_TRACER );
                                for ( Iterator<Point> itr = mMouseTracer.iterator(); itr.hasNext(); ) {
                                    Point pt = itr.next();
                                    int x = pt.x - stdx;
                                    int y = pt.y;
                                    if ( y < graph_min_y ) {
                                        y = graph_min_y;
                                    } else if ( graph_max_y < y ) {
                                        y = graph_max_y;
                                    }
                                    d.append( x, y );
                                }
                                d.flush();

                                /*Vector<Integer> ptx = new Vector<Integer>();
                                Vector<Integer> pty = new Vector<Integer>();
                                int height = getHeight() - 42;

                                int count = 0;
                                int lastx = 0;
                                int lasty = 0;
                                for ( Iterator<Point> itr = mMouseTracer.iterator(); itr.hasNext(); ) {
                                    Point pt = itr.next();
                                    int key = pt.x;
                                    int x = key - stdx;
                                    int y = pt.y;
                                    if ( y < 8 ) {
                                        y = 8;
                                    } else if ( height < y ) {
                                        y = height;
                                    }
                                    if ( count == 0 ) {
                                        lasty = height;
                                    }
                                    ptx.add( x ); pty.add( lasty );
                                    ptx.add( x ); pty.add( y );
                                    lastx = x;
                                    lasty = y;
                                    count++;
                                }

                                ptx.add( lastx ); pty.add( height );
                                g.setColor( new Color( 8, 166, 172, 127 ) );
                                int nPoints = ptx.size();
                                g.fillPolygon( PortUtil.convertIntArray( ptx.toArray( new Integer[] { } ) ),
                                               PortUtil.convertIntArray( pty.toArray( new Integer[] { } ) ),
                                               nPoints );*/
                            }
                        } else if ( tool == EditTool.ERASER || tool == EditTool.ARROW ) {
                            if ( mMouseDownMode == MouseDownMode.CURVE_EDIT && mMouseMoved && AppManager.mCurveSelectingRectangle.width != 0 ) {
                                int xini = AppManager.xCoordFromClocks( AppManager.mCurveSelectingRectangle.x );
                                int xend = AppManager.xCoordFromClocks( AppManager.mCurveSelectingRectangle.x + AppManager.mCurveSelectingRectangle.width );
                                int x_start = Math.Min( xini, xend );
                                if ( x_start < key_width ) {
                                    x_start = key_width;
                                }
                                int x_end = Math.Max( xini, xend );
                                int yini = yCoordFromValue( AppManager.mCurveSelectingRectangle.y );
                                int yend = yCoordFromValue( AppManager.mCurveSelectingRectangle.y + AppManager.mCurveSelectingRectangle.height );
                                int y_start = Math.Min( yini, yend );
                                int y_end = Math.Max( yini, yend );
                                if ( y_start < 8 ) y_start = 8;
                                if ( y_end > height - 42 - 8 ) y_end = height - 42;
                                if ( x_start < x_end ) {
                                    g.setColor( COLOR_A144R255G255B255 );
                                    g.fillRect( x_start, y_start, x_end - x_start, y_end - y_start );
                                }
                            } else if ( mMouseDownMode == MouseDownMode.VEL_EDIT && mVelEditSelected.containsKey( mVelEditLastSelectedID ) ) {
                                if ( mSelectedCurve.equals( CurveType.VEL ) ) {
                                    numeric_view = mVelEditSelected.get( mVelEditLastSelectedID ).editing.ID.Dynamics;
                                } else if ( mSelectedCurve.equals( CurveType.Accent ) ) {
                                    numeric_view = mVelEditSelected.get( mVelEditLastSelectedID ).editing.ID.DEMaccent;
                                } else if ( mSelectedCurve.equals( CurveType.Decay ) ) {
                                    numeric_view = mVelEditSelected.get( mVelEditLastSelectedID ).editing.ID.DEMdecGainRate;
                                }
                            }
                        }
                        if ( mMouseDownMode == MouseDownMode.SINGER_LIST && AppManager.getSelectedTool() != EditTool.ERASER ) {
                            for ( Iterator<SelectedEventEntry> itr = AppManager.itemSelection.getEventIterator(); itr.hasNext(); ) {
                                SelectedEventEntry item = itr.next();
                                int x = AppManager.xCoordFromClocks( item.editing.Clock );
                                g.setColor( COLOR_SINGERBOX_BORDER_HILIGHT );
                                g.drawRect( x, size.height - 2 * OFFSET_TRACK_TAB + 1,
                                           SINGER_ITEM_WIDTH, OFFSET_TRACK_TAB - 2 );
                            }
                        }
                        #endregion
                    }
                    #endregion
                }

                if ( mCurveVisible ) {
                    #region カーブの種類一覧
#if JAVA
                    Font text_font = AppManager.baseFont8;
                    int text_font_height = AppManager.baseFont8Height;
                    int text_font_offset = AppManager.baseFont8OffsetHeight;
#else
                    Font text_font = AppManager.baseFont9;
                    int text_font_height = AppManager.baseFont9Height;
                    int text_font_offset = AppManager.baseFont9OffsetHeight;
#endif
                    Color font_color_normal = Color.black;
                    g.setColor( new Color( 212, 212, 212 ) );
                    g.fillRect( 0, 0, key_width, size.height - 2 * OFFSET_TRACK_TAB );

                    // 現在表示されているカーブの名前
                    g.setFont( text_font );
                    g.setColor( brs_string );
                    boolean is_utau_mode = AppManager.mDrawIsUtau[selected - 1];
                    String name = (is_utau_mode && mSelectedCurve.equals( CurveType.VEL )) ? "INT" : mSelectedCurve.getName();
                    g.drawString( name, 7, text_font_height / 2 - text_font_offset + 1 );

                    for ( int i = 0; i < mViewingCurves.size(); i++ ) {
                        CurveType curve = mViewingCurves.get( i );
                        Rectangle rc = getRectFromCurveType( curve );
                        if ( curve.equals( mSelectedCurve ) || curve.equals( mLastSelectedCurve ) ) {
                            g.setColor( new Color( 108, 108, 108 ) );
                            g.fillRect( rc.x, rc.y, rc.width, rc.height );
                        }
                        g.setColor( rect_curve );
                        g.drawRect( rc.x, rc.y, rc.width, rc.height );
                        int rc_str_x = rc.x + 2;
                        int rc_str_y = rc.y + text_font_height / 2 - text_font_offset + 1;
                        String n = curve.getName();
                        if ( is_utau_mode && curve.equals( CurveType.VEL ) ) {
                            n = "INT";
                        }
                        if ( curve.equals( mSelectedCurve ) ) {
                            g.setColor( Color.white );
                            g.drawString( n, rc_str_x, rc_str_y );
                        } else {
                            g.setColor( font_color_normal );
                            g.drawString( n, rc_str_x, rc_str_y );
                        }
                    }
                    #endregion
                }

                #region 現在のマーカー
                int marker_x = AppManager.xCoordFromClocks( AppManager.getCurrentClock() );
                if ( key_width <= marker_x && marker_x <= size.width ) {
                    g.setColor( Color.white );
                    g.setStroke( new BasicStroke( 2f ) );
                    g.drawLine( marker_x, 0, marker_x, size.height - 18 );
                    g.setStroke( new BasicStroke() );
                }
                #endregion

                // マウス位置での値
                if ( isInRect( mouse.x, mouse.y, new Rectangle( key_width, HEADER, width, graph_height ) ) &&
                     mMouseDownMode != MouseDownMode.PRE_UTTERANCE_MOVE &&
                     mMouseDownMode != MouseDownMode.OVERLAP_MOVE &&
                     mMouseDownMode != MouseDownMode.VEL_EDIT ) {
                    int align = 1;
                    int valign = 0;
                    int shift = 50;
                    if ( mSelectedCurve.equals( CurveType.PIT ) ) {
                        valign = 1;
                        shift = 100;
                    }
                    g.setFont( AppManager.baseFont10Bold );
                    g.setColor( Color.white );
                    PortUtil.drawStringEx( g,
                                           mMouseValue + "",
                                           AppManager.baseFont10Bold,
                                           new Rectangle( mouse.x - 100, mouse.y - shift, 100, 100 ),
                                           align,
                                           valign );
                    if ( mSelectedCurve.equals( CurveType.PIT ) ) {
                        float delta_note = mMouseValue * pbs_at_mouse / 8192.0f;
                        align = 1;
                        valign = -1;
                        PortUtil.drawStringEx( g,
                                               PortUtil.formatDecimal( "#0.00", delta_note ),
                                               AppManager.baseFont10Bold,
                                               new Rectangle( mouse.x - 100, mouse.y, 100, 100 ),
                                               align,
                                               valign );
                    }
                }
            } catch ( Exception ex ) {
                serr.println( "TrackSelector#paint; ex= " + ex );
#if JAVA
                ex.printStackTrace();
#endif
            }
        }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index