~ubuntu-branches/ubuntu/trusty/muse/trusty

« back to all changes in this revision

Viewing changes to muse/mpevent.cpp

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2013-08-28 16:25:57 UTC
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: package-import@ubuntu.com-20130828162557-knls3ip7j262eepx
Tags: upstream-2.1.2
ImportĀ upstreamĀ versionĀ 2.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22
22
//=========================================================
23
23
 
 
24
#include <stdio.h>
 
25
 
24
26
#include "mpevent.h"
25
27
 
26
28
#include "helper.h"
67
69
                  setData(e.eventData());
68
70
                  break;
69
71
            default:
70
 
                  printf("MEvent::MEvent(): event type %d not implemented\n",
 
72
                  fprintf(stderr, "MEvent::MEvent(): event type %d not implemented\n",
71
73
                     type());
72
74
                  break;
73
75
            }
79
81
 
80
82
void MEvent::dump() const
81
83
      {
82
 
      printf("time:%d port:%d chan:%d ", _time, _port, _channel+1);
83
 
      if (_type == 0x90) {   // NoteOn
84
 
            QString s = pitch2string(_a);
85
 
            printf("NoteOn %s(0x%x) %d\n", s.toLatin1().constData(), _a, _b);
86
 
           }
87
 
      else if (_type == 0xf0) {
88
 
            printf("SysEx len %d 0x%0x ...\n", len(), data()[0]);
 
84
      fprintf(stderr, "time:%d port:%d chan:%d ", _time, _port, _channel+1);
 
85
      if (_type == ME_NOTEON) {   
 
86
            QString s = pitch2string(_a);
 
87
            fprintf(stderr, "NoteOn %s(0x%x) %d\n", s.toLatin1().constData(), _a, _b);
 
88
           }
 
89
      else if (_type == ME_NOTEOFF) {  
 
90
            QString s = pitch2string(_a);
 
91
            fprintf(stderr, "NoteOff %s(0x%x) %d\n", s.toLatin1().constData(), _a, _b);
 
92
           }
 
93
      else if (_type == ME_SYSEX) {
 
94
            fprintf(stderr, "SysEx len %d 0x%0x ...\n", len(), data()[0]);
89
95
            }
90
96
      else
91
 
            printf("type:0x%02x a=%d b=%d\n", _type, _a, _b);
 
97
            fprintf(stderr, "type:0x%02x a=%d b=%d\n", _type, _a, _b);
92
98
      }
93
99
 
94
100
//---------------------------------------------------------
184
190
      return 27;  
185
191
  }
186
192
  
187
 
  printf("FIXME: MEvent::sortingWeight: unknown event type:%d\n", _type);
 
193
  fprintf(stderr, "FIXME: MEvent::sortingWeight: unknown event type:%d\n", _type);
188
194
  return 100;
189
195
}
190
196