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

« back to all changes in this revision

Viewing changes to muse/mididev.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:
236
236
        event.setLoopNum(MusEGlobal::audio->loopCount());
237
237
      
238
238
      if (MusEGlobal::midiInputTrace) {
239
 
            printf("MidiInput: ");
 
239
            fprintf(stderr, "MidiInput: ");
240
240
            event.dump();
241
241
            }
242
242
 
288
288
 
289
289
      if (!applyMidiInputTransformation(event)) {
290
290
            if (MusEGlobal::midiInputTrace)
291
 
                  printf("   midi input transformation: event filtered\n");
 
291
                  fprintf(stderr, "   midi input transformation: event filtered\n");
292
292
            return;
293
293
            }
294
294
 
313
313
      // Split the events up into channel fifos. Special 'channel' number 17 for sysex events.
314
314
      unsigned int ch = (typ == ME_SYSEX)? MIDI_CHANNELS : event.channel();
315
315
      if(_recordFifo[ch].put(event))
316
 
        printf("MidiDevice::recordEvent: fifo channel %d overflow\n", ch);
 
316
        fprintf(stderr, "MidiDevice::recordEvent: fifo channel %d overflow\n", ch);
317
317
      }
318
318
 
319
319
//---------------------------------------------------------
530
530
                  sendNullRPNParams(t, port, chn, true);
531
531
                  }
532
532
            else {
533
 
                  printf("putEvent: unknown controller type 0x%x\n", a);
 
533
                  fprintf(stderr, "putEvent: unknown controller type 0x%x\n", a);
534
534
                  }
535
535
            return false;
536
536
#endif
730
730
        drum_found = true; 
731
731
        for(int i = 0; i < DRUM_MAPSIZE; ++i)
732
732
        {
733
 
          if(MusEGlobal::drumMap[i].port != _port || usedChans[MusEGlobal::drumMap[i].channel])
 
733
          // Default to track port if -1 and track channel if -1.
 
734
          int mport = MusEGlobal::drumMap[i].port;
 
735
          if(mport == -1)
 
736
            mport = (*imt)->outPort();
 
737
          int mchan = MusEGlobal::drumMap[i].channel;
 
738
          if(mchan == -1)
 
739
            mchan = (*imt)->outChannel();
 
740
          if(mport != _port || usedChans[mchan])
734
741
            continue;
735
 
          usedChans[MusEGlobal::drumMap[i].channel] = true;
 
742
          usedChans[mchan] = true;
736
743
          ++usedChanCount;
737
744
          if(usedChanCount >= MIDI_CHANNELS)
738
745
            break;  // All are used, done searching.