Guest User

Dynamic minute markers.

a guest
Feb 13th, 2012
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.89 KB | None | 0 0
  1. diff -urN ./mixxx-1.10.0final/src/widget/woverview.cpp ./mixxx-1.10.0orignal/src/widget/woverview.cpp
  2. --- ./mixxx-1.10.0final/src/widget/woverview.cpp    2011-12-24 08:23:20.000000000 +0530
  3. +++ ./mixxx-1.10.0orignal/src/widget/woverview.cpp  2012-02-13 22:14:54.084713000 +0530
  4. @@ -222,6 +222,7 @@
  5.      setData(&ba, 0);
  6.      m_analysing = false;
  7.      m_iProgress = 0;
  8. +    m_minuteMarkerList.clear();
  9.      update();
  10.  }
  11.  
  12. @@ -272,7 +273,14 @@
  13.      //from is deallocated. -- Albert Dec 22, 2009
  14.      m_waveformSummary = *pWaveformSummary;
  15.      m_liSampleDuration = liSampleDuration;
  16. -
  17. +    TrackInfoObject* pTrackInfo = m_pCurrentTrack.data();
  18. +    long oneMinute = 2 * (pTrackInfo->getSampleRate()) * 60;
  19. +    m_roundDurationMinutes = (long)(m_liSampleDuration/oneMinute);
  20. +    long increment = oneMinute;
  21. +    for(int i = 0; i <= m_roundDurationMinutes; i++){
  22. +       m_minuteMarkerList.append(float(oneMinute) * (width()-2)/m_liSampleDuration);
  23. +   oneMinute = (long)(oneMinute + increment);
  24. +    }
  25.      waveformChanged = true;
  26.  }
  27.  
  28. @@ -301,6 +309,10 @@
  29.          if (m_waveformSummary.at(i)+128>hfcMax)
  30.              hfcMax = m_waveformSummary.at(i)+128;
  31.      }
  32. +    paint.setPen(QColor(255,255,255));
  33. +    for(int i = 0; i<m_minuteMarkerList.size(); i++){
  34. +       paint.drawLine(m_minuteMarkerList[i], 0, m_minuteMarkerList[i], height());
  35. +    }
  36.  
  37.      // Draw waveform using hfc to determine color
  38.      for (int i=0; i<width(); ++i)
  39. diff -urN ./mixxx-1.10.0final/src/widget/woverview.h ./mixxx-1.10.0orignal/src/widget/woverview.h
  40. --- ./mixxx-1.10.0final/src/widget/woverview.h  2011-12-24 08:23:20.000000000 +0530
  41. +++ ./mixxx-1.10.0orignal/src/widget/woverview.h    2012-02-13 21:07:15.757238000 +0530
  42. @@ -105,6 +105,9 @@
  43.      QColor m_qColorSignal;
  44.      QColor m_qColorProgress;
  45.      int m_iProgressAlpha;
  46. +
  47. +    int m_roundDurationMinutes;
  48. +    QList<float> m_minuteMarkerList;
  49.  };
  50.  
  51.  #endif
Advertisement
Add Comment
Please, Sign In to add comment