~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to muse/widgets/utils.cpp

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2012-07-18 16:07:06 UTC
  • mfrom: (1.1.12) (10.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20120718160706-qy1lydijykeiqqmg
Tags: 2.0-1
* New stable release.
* debian/rules: Exclude muse/widgets/arrangercolumns.{cpp,h}~ from being
  deleted by dh_clean.
* Drop 0002-gcc_hardening.patch, applied upstream.
* Drop 0003-ftbfs_gcc47.patch, applied upstream.
* Refresh 1001-buildsystem.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include <QPainter>
38
38
#include <QPointF>
39
39
 
 
40
#include "audio.h"
 
41
#include "audiodev.h"
40
42
#include "part.h"
41
43
#include "utils.h"
42
44
#include "xml.h"
49
51
 
50
52
double curTime()
51
53
      {
52
 
      struct timeval t;
53
 
      gettimeofday(&t, 0);
54
 
      //printf("%ld %ld\n", t.tv_sec, t.tv_usec);  // Note I observed values coming out of order! Causing some problems.
55
 
      return (double)((double)t.tv_sec + (t.tv_usec / 1000000.0));
 
54
      // No audio device yet? Just get wall clock time.
 
55
      if(!MusEGlobal::audioDevice)  
 
56
      {
 
57
        struct timeval t;
 
58
        gettimeofday(&t, 0);
 
59
        //printf("%ld %ld\n", t.tv_sec, t.tv_usec);  // Note I observed values coming out of order! Causing some problems.
 
60
        return (double)((double)t.tv_sec + (t.tv_usec / 1000000.0));
 
61
      }
 
62
      
 
63
      // Ask the driver for the system time. 
 
64
      // May depend on selected clock source. 
 
65
      // With Jack, may be based upon wallclock time, the   
 
66
      //  processor cycle counter or the HPET clock etc.
 
67
      return MusEGlobal::audioDevice->systemTime();
 
68
      
56
69
      /*
57
 
      // Changed by Tim. p4.0.23
58
70
      struct timespec t;
59
71
      //clock_gettime(CLOCK_MONOTONIC, &t);
60
72
      //clock_gettime(CLOCK_MONOTONIC_RAW, &t);