~s-cecilio/lenmus/v5.3

« back to all changes in this revision

Viewing changes to src/graphic/Formatter4.cpp

  • Committer: cecilios
  • Date: 2007-06-10 20:08:10 UTC
  • Revision ID: svn-v4:2587a929-2f0e-0410-ae78-fe6f687d5efe:trunk:251

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
#include "wx/debug.h"
42
42
#include "wx/list.h"
 
43
#include "wx/numdlg.h"      // for ::wxGetNumberFromUser
 
44
 
43
45
#include "../score/Score.h"
44
46
#include "TimeposTable.h"
45
47
#include "Formatter4.h"
53
55
 
54
56
lmFormatter4::lmFormatter4()
55
57
{
 
58
    // set debugging options
56
59
    m_fDebugMode = g_pLogger->IsAllowedTraceMask(_T("Formater4"));
57
 
        //wxString sData = ::wxGetTextFromUser(_("Mask to add"));
 
60
    m_nTraceMeasure = 0;
 
61
    if (m_fDebugMode) {
 
62
        m_nTraceMeasure = ::wxGetNumberFromUser(
 
63
                                _T("Specify the measure to trace (0 for all measures)"),
 
64
                                _T("Measure: "), 
 
65
                                _T("Debug Formatter4"),
 
66
                                0L);        // default value: all measures
 
67
    }
58
68
 
59
69
}
60
70
 
312
322
            m_nMeasureSize[nRelMeasure] =
313
323
                SizeMeasureColumn(nAbsMeasure, nRelMeasure, nSystem, pPaper, &fNewSystem);
314
324
 
315
 
///*LogDbg*/        wxLogMessage(wxString::Format(_T("[lmFormatter4::RenderJustified]: ")
316
 
//                    _T("m_nMeasureSize[%d] = %d"), nRelMeasure, m_nMeasureSize[nRelMeasure] ));
 
325
            #if defined(__WXDEBUG__)
 
326
            g_pLogger->LogTrace(_T("Formatter4.Step1"),
 
327
                _T("m_nMeasureSize[%d] = %d"), nRelMeasure, m_nMeasureSize[nRelMeasure] );
 
328
            #endif
317
329
 
318
330
            //if this is the first measure column compute the space available in
319
331
            //this system. The method is a little tricky. The total space available
326
338
                    pPaper->GetRightMarginXPos() - m_oTimepos[nRelMeasure].GetStartOfBarPosition();
327
339
            }
328
340
 
329
 
///*LogDbg*/        wxLogMessage(wxString::Format(_T("[lmFormatter4::RenderJustified]: ")
330
 
//                    _T("m_nFreeSpace = %d, PageRightMargin=%d, StartOfBar=%d"),
331
 
//                    m_nFreeSpace, pPaper->GetPageRightMargin(), m_oTimepos[nRelMeasure].GetStartOfBarPosition() ));
332
 
///*LogDbg*/        wxLogMessage(m_oTimepos[nRelMeasure].DumpTimeposTable());
 
341
            #if defined(__WXDEBUG__)
 
342
            g_pLogger->LogTrace(_T("Formatter4.Step1"),
 
343
                _T("m_nFreeSpace = %d, PageRightMargin=%d, StartOfBar=%d"),
 
344
                m_nFreeSpace, pPaper->GetPageRightMargin(), 
 
345
                m_oTimepos[nRelMeasure].GetStartOfBarPosition() );
 
346
            g_pLogger->LogTrace(_T("Formatter4.Step1"),
 
347
                m_oTimepos[nRelMeasure].DumpTimeposTable());
 
348
            #endif
333
349
 
334
350
            //substract space ocupied by this measure from space available in the system
335
351
            if (m_nFreeSpace < m_nMeasureSize[nRelMeasure]) {
574
590
    //sounding at the same time will have the same x coordinate. The method .ArrageStaffobjsByTime
575
591
    //returns the measure column size
576
592
    *pNewSystem = fNewSystem;
577
 
    return m_oTimepos[nRelMeasure].ArrangeStaffobjsByTime(m_fDebugMode);      //true = debug on
 
593
    bool fTrace =  m_fDebugMode && (m_nTraceMeasure == 0 || m_nTraceMeasure == nAbsMeasure);
 
594
    return m_oTimepos[nRelMeasure].ArrangeStaffobjsByTime(fTrace);      //true = debug on
578
595
 
579
596
}
580
597