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

« back to all changes in this revision

Viewing changes to muse/exportmidi.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2010-11-17 21:43:38 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20101117214338-1hvfl7oo2dsqnvrb
Tags: 1.1-0ubuntu1
* New upstream release (LP: #668631)
* Switch to dpkg-source 3.0 (quilt) format
* Switch to dh7 short form
* debian/rules:
  - added --enable-dssi and --enable-osc to conf flags for dssi support
  - added -ljackserver to LDFLAGS to fix a FTBFS because of --as-needed
* debian/control:
  - added build build dependency on liblo-dev and dssi-dev for dssi support
  - bump Standards-version to 3.9.1. No changes required.
* debian/muse.desktop, debian/muse.xpm: dropped as desktop file and icon is
  now shipped upstream.
* fix-desktop-categories.patch: fix Categories tag in upstream desktop file
* 10_es_locale_fix.dpatch: refreshed and converted to quilt as
  fix_es_locale.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
static void addController(MPEventList* l, int tick, int port, int channel, int a, int b)
31
31
      {
32
 
      if (a < 0x1000) {          // 7 Bit Controller
 
32
      // p3.3.37
 
33
      //if (a < 0x1000) {          // 7 Bit Controller
 
34
      if (a < CTRL_14_OFFSET) {          // 7 Bit Controller
33
35
            l->add(MidiPlayEvent(tick, port, channel, ME_CONTROLLER, a, b));
34
36
            }
35
 
      else if (a < 0x20000) {     // 14 Bit Controller
 
37
      //else if (a < 0x20000) {     // 14 Bit Controller
 
38
      else if (a < CTRL_RPN_OFFSET) {     // 14 Bit Controller
36
39
            int ctrlH = (a >> 8) & 0x7f;
37
40
            int ctrlL = a & 0x7f;
38
41
            int dataH = (b >> 7) & 0x7f;
40
43
            l->add(MidiPlayEvent(tick, port, channel, ME_CONTROLLER, ctrlH, dataH));
41
44
            l->add(MidiPlayEvent(tick+1, port, channel, ME_CONTROLLER, ctrlL, dataL));
42
45
            }
43
 
      else if (a < 0x30000) {     // RPN 7-Bit Controller
 
46
      //else if (a < 0x30000) {     // RPN 7-Bit Controller
 
47
      else if (a < CTRL_NRPN_OFFSET) {     // RPN 7-Bit Controller
44
48
            int ctrlH = (a >> 8) & 0x7f;
45
49
            int ctrlL = a & 0x7f;
46
50
            l->add(MidiPlayEvent(tick, port, channel, ME_CONTROLLER, CTRL_HRPN, ctrlH));
47
51
            l->add(MidiPlayEvent(tick+1, port, channel, ME_CONTROLLER, CTRL_LRPN, ctrlL));
48
52
            l->add(MidiPlayEvent(tick+2, port, channel, ME_CONTROLLER, CTRL_HDATA, b));
49
53
            }
50
 
      else if (a < 0x40000) {     // NRPN 7-Bit Controller
 
54
      //else if (a < 0x40000) {     // NRPN 7-Bit Controller
 
55
      else if (a < CTRL_INTERNAL_OFFSET) {     // NRPN 7-Bit Controller
51
56
            int ctrlH = (a >> 8) & 0x7f;
52
57
            int ctrlL = a & 0x7f;
53
58
            l->add(MidiPlayEvent(tick, port, channel, ME_CONTROLLER, CTRL_HNRPN, ctrlH));
82
87
                  }
83
88
            l->add(MidiPlayEvent(tick+tickoffset, port, channel, ME_PROGRAM, pr, 0));
84
89
            }
85
 
      else if (a < 0x60000) {     // RPN14 Controller
 
90
      //else if (a < 0x60000) {     // RPN14 Controller
 
91
      else if (a < CTRL_NRPN14_OFFSET) {     // RPN14 Controller
86
92
            int ctrlH = (a >> 8) & 0x7f;
87
93
            int ctrlL = a & 0x7f;
88
94
            int dataH = (b >> 7) & 0x7f;
92
98
            l->add(MidiPlayEvent(tick+2, port, channel, ME_CONTROLLER, CTRL_HDATA, dataH));
93
99
            l->add(MidiPlayEvent(tick+3, port, channel, ME_CONTROLLER, CTRL_LDATA, dataL));
94
100
            }
95
 
      else if (a < 0x70000) {     // NRPN14 Controller
 
101
      //else if (a < 0x70000) {     // NRPN14 Controller
 
102
      else if (a < CTRL_NONE_OFFSET) {     // NRPN14 Controller
96
103
            int ctrlH = (a >> 8) & 0x7f;
97
104
            int ctrlL = a & 0x7f;
98
105
            int dataH = (b >> 7) & 0x7f;
112
119
      {
113
120
      MFile file(QString("midis"), QString(".mid"));
114
121
 
115
 
      FILE* fp = file.open("w", midi_file_pattern, this, false, true,
 
122
      //FILE* fp = file.open("w", midi_file_pattern, this, false, true,
 
123
      FILE* fp = file.open("w", midi_file_save_pattern, this, false, true,
116
124
         tr("MusE: Export Midi"));
117
125
      if (fp == 0)
118
126
            return;