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

« back to all changes in this revision

Viewing changes to muse/synth.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:
30
30
#include <vector>
31
31
#include <fcntl.h>
32
32
#include <dlfcn.h>
 
33
#include <stdio.h>
33
34
 
34
35
#include <QDir>
35
36
#include <QString>
203
204
                (type == Synth::SYNTH_TYPE_END || type == (*i)->synthType()) )
204
205
              return *i;
205
206
         }
206
 
      printf("synthi type:%d class:%s label:%s not found\n", type, sclass.toLatin1().constData(), label.toLatin1().constData());
 
207
      fprintf(stderr, "synthi type:%d class:%s label:%s not found\n", type, sclass.toLatin1().constData(), label.toLatin1().constData());
207
208
      return 0;
208
209
      }
209
210
 
227
228
                  }
228
229
            }
229
230
      else
230
 
            printf("createSynthInstance: synthi class:%s label:%s not found\n", sclass.toLatin1().constData(), label.toLatin1().constData());
 
231
            fprintf(stderr, "createSynthInstance: synthi class:%s label:%s not found\n", sclass.toLatin1().constData(), label.toLatin1().constData());
231
232
      return si;
232
233
      }
233
234
 
354
355
  {
355
356
    if (MusEGlobal::midiOutputTrace)
356
357
    {
357
 
          printf("MidiOut: Synth: <%s>: ", name().toLatin1().constData());
 
358
          fprintf(stderr, "MidiOut: Synth: <%s>: ", name().toLatin1().constData());
358
359
          ev.dump();
359
360
    }
360
361
    return _sif->putEvent(ev);
561
562
      //synthesizer->incInstances(-1); // Moved below by Tim. p3.3.14
562
563
      
563
564
      if(MusEGlobal::debugMsg)
564
 
        printf("SynthI::deactivate3 deleting _sif...\n");
 
565
        fprintf(stderr, "SynthI::deactivate3 deleting _sif...\n");
565
566
      
566
567
      delete _sif;
567
568
      _sif = 0;
568
569
      
569
570
      if(MusEGlobal::debugMsg)
570
 
        printf("SynthI::deactivate3 decrementing synth instances...\n");
 
571
        fprintf(stderr, "SynthI::deactivate3 decrementing synth instances...\n");
571
572
      
572
573
      synthesizer->incInstances(-1);
573
574
      }
602
603
 
603
604
      QDir pluginDir(s, QString("*.so")); // ddskrjo
604
605
      if (MusEGlobal::debugMsg)
605
 
            printf("searching for software synthesizer in <%s>\n", s.toLatin1().constData());
 
606
            fprintf(stderr, "searching for software synthesizer in <%s>\n", s.toLatin1().constData());
606
607
      if (pluginDir.exists()) {
607
608
            QFileInfoList list = pluginDir.entryInfoList();
608
609
            QFileInfoList::iterator it=list.begin();
652
653
                  ++it;
653
654
                  }
654
655
            if (MusEGlobal::debugMsg)
655
 
                  printf("%zd soft synth found\n", MusEGlobal::synthis.size());
 
656
                  fprintf(stderr, "%zd soft synth found\n", MusEGlobal::synthis.size());
656
657
            }
657
658
      }
658
659
 
1054
1055
          int frame = evTime - abs(frameOffset);
1055
1056
 
1056
1057
            if (frame >= endPos) {
1057
 
                printf("frame > endPos!! frame = %d >= endPos %d, i->time() %d, frameOffset %d curPos=%d\n", frame, endPos, i->time(), frameOffset,curPos);
 
1058
                fprintf(stderr, "frame > endPos!! frame = %d >= endPos %d, i->time() %d, frameOffset %d curPos=%d\n", frame, endPos, i->time(), frameOffset,curPos);
1058
1059
                continue;
1059
1060
                }
1060
1061
 
1061
1062
            if (frame > curPos) {
1062
1063
                  if (frame < (int) pos)
1063
 
                        printf("should not happen: missed event %d\n", pos -frame);
 
1064
                        fprintf(stderr, "should not happen: missed event %d\n", pos -frame);
1064
1065
                  else 
1065
1066
                  {
1066
1067
                        if (!_mess)
1067
 
                              printf("should not happen - no _mess\n");
 
1068
                              fprintf(stderr, "should not happen - no _mess\n");
1068
1069
                        else
1069
1070
                        {
1070
1071
                                _mess->process(buffer, curPos-pos, frame - curPos);
1084
1085
      if (endPos - curPos) 
1085
1086
      {
1086
1087
            if (!_mess)
1087
 
                  printf("should not happen - no _mess\n");
 
1088
                  fprintf(stderr, "should not happen - no _mess\n");
1088
1089
            else
1089
1090
            {
1090
1091
                    _mess->process(buffer, curPos - off, endPos - curPos);