~s-cecilio/lenmus/v5.1.x

« back to all changes in this revision

Viewing changes to src/app/ScoreCanvas.cpp

  • Committer: cecilios
  • Date: 2008-09-22 16:39:15 UTC
  • Revision ID: svn-v4:2587a929-2f0e-0410-ae78-fe6f687d5efe:trunk:389

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
        if (fFromMeasure)
215
215
                pScore->PlayFromMeasure(nMeasure, lmVISUAL_TRACKING, ePM_NormalInstrument, 0, this);
216
216
        else
217
 
                pScore->Play(lmVISUAL_TRACKING, NO_MARCAR_COMPAS_PREVIO, ePM_NormalInstrument, 0, this);
 
217
                pScore->Play(lmVISUAL_TRACKING, lmNO_COUNTOFF, ePM_NormalInstrument, 0, this);
218
218
}
219
219
 
220
220
void lmScoreCanvas::StopPlaying(bool fWait)
744
744
 
745
745
void lmScoreCanvas::OnKeyPress(wxKeyEvent& event)
746
746
{
747
 
    wxLogMessage(_T("[lmScoreCanvas::OnKeyPress] KeyCode=%s (%d), KeyDown data: Keycode=%s (%d), (flags = %c%c%c%c)"),
748
 
            KeyCodeToName(event.GetKeyCode()).c_str(), event.GetKeyCode(),
749
 
            KeyCodeToName(m_nKeyDownCode).c_str(), m_nKeyDownCode,
750
 
            (m_fCmd ? _T('C') : _T('-') ),
751
 
            (m_fAlt ? _T('A') : _T('-') ),
752
 
            (m_fShift ? _T('S') : _T('-') ),
753
 
            (event.MetaDown() ? _T('M') : _T('-') )
754
 
            );
 
747
    //wxLogMessage(_T("[lmScoreCanvas::OnKeyPress] KeyCode=%s (%d), KeyDown data: Keycode=%s (%d), (flags = %c%c%c%c)"),
 
748
    //        KeyCodeToName(event.GetKeyCode()).c_str(), event.GetKeyCode(),
 
749
    //        KeyCodeToName(m_nKeyDownCode).c_str(), m_nKeyDownCode,
 
750
    //        (m_fCmd ? _T('C') : _T('-') ),
 
751
    //        (m_fAlt ? _T('A') : _T('-') ),
 
752
    //        (m_fShift ? _T('S') : _T('-') ),
 
753
    //        (event.MetaDown() ? _T('M') : _T('-') )
 
754
    //        );
755
755
    ProcessKey(event);
756
756
}
757
757
 
862
862
                            lmToolPageNotes* pNoteOptions = pToolBox->GetNoteProperties();
863
863
                            lmENoteType nNoteType = pNoteOptions->GetNoteDuration();
864
864
                            int nDots = pNoteOptions->GetNoteDots();
865
 
                            float rDuration = lmLDPParser::GetDefaultDuration(nNoteType, nDots, 0, 0);
866
865
                            lmENoteHeads nNotehead = pNoteOptions->GetNoteheadType();
867
866
                            lmEAccidentals nAcc = pNoteOptions->GetNoteAccidentals();
868
867
                                m_nOctave = pNoteOptions->GetOctave();
887
886
                    }
888
887
                }
889
888
 
 
889
                //compute note/rest duration
 
890
                            float rDuration = lmLDPParser::GetDefaultDuration(nNoteType, nDots, 0, 0);
 
891
 
890
892
                //insert note
891
893
                if ((nKeyCode >= int('A') && nKeyCode <= int('G')) ||
892
894
                    (nKeyCode >= int('a') && nKeyCode <= int('g')) )
1080
1082
    }
1081
1083
 
1082
1084
        //Display command
1083
 
    GetMainFrame()->SetStatusBarMsg(wxString::Format(_T("cmd: %s"), m_sCmd.c_str() ));
 
1085
    //GetMainFrame()->SetStatusBarMsg(wxString::Format(_T("cmd: %s"), m_sCmd.c_str() ));
1084
1086
}
1085
1087
 
1086
1088
void lmScoreCanvas::LogKeyEvent(wxString name, wxKeyEvent& event, int nTool)
1365
1367
void lmScoreCanvas::OnViewPageMargins(wxCommandEvent& event)
1366
1368
{
1367
1369
    g_fShowMargins = !g_fShowMargins;
1368
 
    g_pTheApp->UpdateCurrentDocViews();
 
1370
    GetMainFrame()->GetActiveDoc()->UpdateAllViews();
1369
1371
}
1370
1372
 
1371
1373
void lmScoreCanvas::SelectNoteDuration(int iButton)
1841
1843
    // - or to add a note to a beamed group
1842
1844
 
1843
1845
    //Conditions to be valid:
1844
 
    //   1. All notes/rest in the seleccion are consecutive, are in the same voice, and
1845
 
    //      must be eighths or shorter ones.
 
1846
    //   1. All notes/rest in the seleccion are consecutive, are in the same
 
1847
    //      voice (unless in chord), and must be eighths or shorter ones.
1846
1848
    //   2. If not beamed, first note/rest must be a note
1847
1849
    //   3. If not beamed, last note/rest must be a note
1848
1850
    //   4. If beamed, all selected note/rest must not be in the same beam
1881
1883
                // verify voice, and that it is an eighth or shorter
1882
1884
                pLast = (lmNoteRest*)pGMO->GetScoreOwner();
1883
1885
                fValid &= pLast->GetNoteType() >= eEighth;
1884
 
                fValid &= nVoice == pLast->GetVoice();
 
1886
                fValid &= nVoice == pLast->GetVoice() || 
 
1887
                          (pLast->IsNote() && ((lmNote*)pLast)->IsInChord());
1885
1888
 
1886
1889
                //verify that if beamed, all selected note/rest must not be in the same beam
1887
1890
                fAllBeamed &= pLast->IsBeamed();