~ubuntu-branches/ubuntu/utopic/musescore/utopic

« back to all changes in this revision

Viewing changes to mscore/mscore/keysig.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Niall Creech
  • Date: 2010-09-21 19:23:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100921192350-dhx7ynjk9r06o2it
Tags: 0.9.6.2+dfsg-1ubuntu1
* 20_armel-float-cast-fix.dpatch:
  - Define alternative rxpos and rypos calls for armel to handle
  its differenet QpointF rx() and ry() call return values. Ensure qMax
  and qMin calls have equivalent argument types(LP: #642117)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//=============================================================================
2
2
//  MuseScore
3
3
//  Linux Music Score Editor
4
 
//  $Id: keysig.cpp 2919 2010-03-27 21:30:45Z wschweer $
 
4
//  $Id: keysig.cpp 3269 2010-07-09 20:20:39Z lasconic $
5
5
//
6
6
//  Copyright (C) 2002-2007 Werner Schweer and others
7
7
//
65
65
      for (Element* e = parent(); e; e = e->parent())
66
66
            xp += e->x();
67
67
      System* system = segment()->measure()->system();
68
 
      double yp = y() + system->staff(staffIdx())->y() + system->y();
 
68
      double yp = y();
 
69
      if (system)
 
70
            yp += system->staff(staffIdx())->y() + system->y();
69
71
      return QPointF(xp, yp);
70
72
      }
71
73
 
76
78
void KeySig::setCustom(const QList<KeySym*>& symbols)
77
79
      {
78
80
      KeySigEvent k = subtype();
79
 
      k.custom = true;
 
81
      k.setCustom(true);
80
82
      setSubtype(k);
81
83
      keySymbols = symbols;
82
84
      }
121
123
            yoff = clefTable[clef].yOffset;
122
124
            }
123
125
 
124
 
      char t1  = keySigEvent().accidentalType;
125
 
      char t2  = keySigEvent().naturalType;
 
126
      char t1  = keySigEvent().accidentalType();
 
127
      char t2  = keySigEvent().naturalType();
126
128
      qreal xo = 0.0;
127
129
 
128
130
      int accidentals = 0, naturals = 0;
223
225
            KeySig* ks    = static_cast<KeySig*>(e);
224
226
            KeySigEvent k = ks->keySigEvent();
225
227
// printf("drop ");k.print(); printf("\n");
226
 
            if (k.custom) {
 
228
            if (k.custom()) {
227
229
                  int customIdx = score()->customKeySigIdx(ks);
228
230
                  if (customIdx == -1)
229
231
                        customIdx = score()->addCustomKeySig(ks);
248
250
void KeySig::setSig(int old, int newSig)
249
251
      {
250
252
      KeySigEvent ks;
251
 
      ks.naturalType = old;
252
 
      ks.accidentalType = newSig;
253
 
      ks.invalid = false;
254
 
      ks.custom = false;
 
253
      ks.setNaturalType(old);
 
254
      ks.setAccidentalType(newSig);
255
255
      setSubtype(ks);
256
256
      }
257
257
 
262
262
void KeySig::setOldSig(int old)
263
263
      {
264
264
      KeySigEvent ks(subtype());
265
 
      ks.naturalType = old;
 
265
      ks.setNaturalType(old);
266
266
      setSubtype(ks);
267
267
      }
268
268
 
355
355
      {
356
356
      if (keySigEvent() == t)
357
357
            return;
358
 
      if (t.custom) {
359
 
            KeySig* ks = _score->customKeySig(t.customType);
 
358
      if (t.custom()) {
 
359
            KeySig* ks = _score->customKeySig(t.customType());
360
360
            foreach(KeySym* k, keySymbols)
361
361
                  delete k;
362
362
            keySymbols.clear();