@@ -571,14 +571,14 @@ MidiPlugin::MidiPlugin()
571571 plugin = this ;
572572 player = NULL ;
573573 coVRPluginList::instance ()->addPlugin (" Vrml97" );
574-
574+
575575 initOPCUA ();
576576
577577 MIDITab = NULL ;
578578 startTime = 0 ;
579579 // Initialize SDL
580-
581-
580+
581+
582582 udp = new UDPComm (" localhost" , 51322 , 51324 );
583583 if (coVRMSController::instance ()->isMaster ())
584584 {
@@ -722,11 +722,11 @@ void NoteInfo::createGeom()
722722 colorMaterial->setShininess (osg::Material::FRONT_AND_BACK , 16 .0f );
723723
724724 geoState->setAttributeAndModes (colorMaterial, osg::StateAttribute::ON );
725-
726-
727-
728-
729-
725+
726+
727+
728+
729+
730730 geometry = mt;
731731 }
732732 if (geometry == NULL )
@@ -834,7 +834,7 @@ MidiDevice::~MidiDevice()
834834bool MidiPlugin::init ()
835835{
836836 currentTrack = 0 ;
837-
837+
838838#ifdef HAVE_ALSA
839839
840840 if (coVRMSController::instance ()->isMaster ())
@@ -965,7 +965,7 @@ device_list();
965965 {
966966 coVRFileManager::instance ()->loadFile (objFileName.c_str (), 0 , thereminTransform);
967967 }
968-
968+
969969 BBVisitor bbVisitor;
970970 thereminTransform->accept (bbVisitor);
971971
@@ -1005,9 +1005,9 @@ device_list();
10051005 {
10061006 OpenMidiDevice (DeviceName,hMidiDevice[streamNum],hMidiDeviceOut[streamNum]);
10071007 }
1008-
1008+
10091009 // snd_rawmidi_read(hMidiDevice[streamNum], NULL, 0); /* trigger reading */
1010-
1010+
10111011 #endif
10121012 }
10131013 else
@@ -1030,7 +1030,7 @@ device_list();
10301030 streamNum++;
10311031 if (streamNum >= NUMMidiStreams)
10321032 break ;
1033-
1033+
10341034 }
10351035 int midiPortOut = coCoviseConfig::getInt (" OutPort" , " COVER.Plugin.Midi" , 1 );
10361036 fprintf (stderr, " OpenMidiOut %d\n " , midiPortOut);
@@ -1134,7 +1134,7 @@ ControllerInfo::ControllerInfo(std::string& cn)
11341134 min = coCoviseConfig::getFloat (" min" , configName, min);
11351135 max = coCoviseConfig::getFloat (" max" , configName, max);
11361136 minOut = coCoviseConfig::getFloat (" minOut" , configName, minOut);
1137- maxOut = coCoviseConfig::getFloat (" maxOut" , configName, maxOut);
1137+ maxOut = coCoviseConfig::getFloat (" maxOut" , configName, maxOut);
11381138 actionName = coCoviseConfig::getEntry (" action" , configName, " NONE" );
11391139 if (actionName == " Shader0" )
11401140 action = Shader0;
@@ -1417,9 +1417,9 @@ bool MidiPlugin::update()
14171417
14181418 } while (me.getP0 () != 0 || me.getP1 () != 0 );
14191419 }
1420-
1421-
1422-
1420+
1421+
1422+
14231423 return true ;
14241424}
14251425
@@ -1485,7 +1485,7 @@ void MidiPlugin::preFrame()
14851485 {
14861486 std::cerr << " Controller: " << me.getCommandByte () << std::endl;
14871487 fprintf (stderr, " Raw: p0 %d, p1 %d, p2 %d, p3 %d\n " , me.getP0 (), me.getP1 (), me.getP2 (), me.getP3 ());
1488-
1488+
14891489 }
14901490 else if (me.isEndOfTrack ())
14911491 {
@@ -1719,7 +1719,7 @@ void MidiPlugin::handleController(MidiEvent& me)
17191719 if (spiralSpeed > 5 )
17201720 spiralSpeed = 5 ;
17211721 spiralSpeedSlider->setValue (spiralSpeed);
1722-
1722+
17231723 }
17241724 else
17251725 {
@@ -1939,7 +1939,7 @@ void MidiPlugin::MIDItab_create(void)
19391939 sphereScaleSlider->setCallback ([this ](float value, bool ) {
19401940 sphereScale = value;
19411941 });
1942-
1942+
19431943 trackNumber = new ui::EditField (MIDITab, " trackNumber" );
19441944 trackNumber->setValue (0 );
19451945 trackNumber->setCallback ([this ](std::string newVal) {
@@ -2133,7 +2133,7 @@ void Track::addNote(Note *n)
21332133 if (n->track ->instrument ->type == " keyboard" )
21342134 {
21352135 // check if there is already a note on, then turn it off
2136-
2136+
21372137 // find key press for this release
21382138 for (auto it = notes.end (); it != notes.begin (); )
21392139 {
@@ -2155,7 +2155,7 @@ void Track::addNote(Note *n)
21552155 break ;
21562156 }
21572157 }
2158-
2158+
21592159 notes.push_back (n);
21602160 n->setInactive (false );
21612161 n->vertNum = lineVert->size ();
@@ -2243,12 +2243,12 @@ void Track::endNote(MidiEvent& me)
22432243 {
22442244 // this is an end Note without a note On, treat it as noteOn if this is a keyboard or guitar
22452245 addNote (new Note (me, this ));
2246- }
2246+ }
22472247 if (note != NULL )
22482248 {
22492249
22502250 }
2251-
2251+
22522252}
22532253
22542254void Track::setRotation (osg::Vec3& rotSpeed)
@@ -2373,14 +2373,14 @@ void Track::update()
23732373 char buf[1000 ];
23742374 int numRead = 1 ;
23752375 while (numRead > 0 )
2376- {
2377-
2376+ {
2377+
23782378 me.setP0 (0 );
23792379 me.setP1 (0 );
23802380 me.setP2 (0 );
23812381 if (coVRMSController::instance ()->isMaster ())
23822382 {
2383-
2383+
23842384 #ifdef HAVE_ALSA
23852385 unsigned char buf[256 ];
23862386 int i, length=0 ;
@@ -2413,7 +2413,7 @@ void Track::update()
24132413 numRead=2 ;
24142414 err = snd_rawmidi_read (MidiPlugin::instance ()->hMidiDevice [trackNumber], buf+1 , 2 );
24152415 }
2416-
2416+
24172417 if (err > 0 )
24182418 fprintf (stderr," length: %d trackNumber: %d buf0:%x\n " ,err,trackNumber,buf[0 ]);
24192419 if (err <= 0 )
@@ -2522,7 +2522,7 @@ void Track::update()
25222522 buf[3 ] = numRead;
25232523 coVRMSController::instance ()->sendSlaves ((char *)buf, 4 );
25242524// fprintf(stderr, "sent: %01d %02d velo %03d chan %d numRead %d streamnum %d\n", me.isNoteOn(), me.getKeyNumber(), me.getVelocity(), me.getChannel(), numRead, streamNum);*/
2525-
2525+
25262526
25272527 if (numRead > 0 )
25282528 {
@@ -2549,7 +2549,7 @@ void Track::update()
25492549 numRead = buf[3 ];
25502550 // fprintf(stderr,"received: %01d %02d velo %03d chan %d numRead %d\n", me.isNoteOn(),me.getKeyNumber(), me.getVelocity(), me.getChannel(),numRead);
25512551 }
2552-
2552+
25532553 if (numRead > 0 && me.getP0 ()!=0 )
25542554 {
25552555
@@ -2646,7 +2646,7 @@ Note::Note(MidiEvent &me, Track *t)
26462646 break ;
26472647 }
26482648 }
2649-
2649+
26502650 // event.setKeyNumber(0);
26512651 }
26522652 transform->setMatrix (osg::Matrix::scale (noteScale, noteScale, noteScale) * osg::Matrix::translate (ni->initialPosition ));
@@ -2875,7 +2875,7 @@ WaveSurface::WaveSurface(osg::Group * p, AudioInStream *s, int w)
28752875 }
28762876
28772877 geoState->setAttributeAndModes (globalDefaultMaterial.get (), osg::StateAttribute::ON );
2878-
2878+
28792879 osg::BoundingBox *boundingBox = new osg::BoundingBox (-radius1*2 , -radius1*20 , -radius1*2 ,radius1*2 , radius1*20 , radius1*2 );
28802880 geom->setInitialBound (*boundingBox);
28812881}
@@ -3070,9 +3070,9 @@ int run(UA_String* transportProfile,
30703070
30713071
30723072int MidiPlugin::initOPCUA () {
3073-
30743073
3075-
3074+
3075+
30763076 /* if (strncmp(argv[1], "opc.udp://", 10) == 0) {
30773077 networkAddressUrl.url = UA_STRING(argv[1]);
30783078 }
@@ -3128,9 +3128,9 @@ int MidiPlugin::initOPCUA() {
31283128
31293129 UA_StatusCode retval = UA_Server_run_startup (server);
31303130
3131-
3131+
31323132#endif
3133-
3133+
31343134
31353135 return 1 ;
31363136
@@ -3227,7 +3227,7 @@ void TriplePlay::MIDItab_create(void)
32273227 setParam (MIDIMode, ftpValue::Poly);
32283228 setParam (MIDIMode, ftpValue::Poly);
32293229 });
3230-
3230+
32313231 sensitivity = std::make_unique<opencover::ui::SliderConfigValue>(FTPGroup, " sensitivity" , 50.0 , *MidiPlugin::instance ()->config ()," TriplePlay" ,config::Flag::Default);
32323232 sensitivity->ui ()->setBounds (MinDynamicsSensitivity,MaxDynamicsSensitivity);
32333233 sensitivity->ui ()->setIntegral (true );
@@ -3284,7 +3284,7 @@ void TriplePlay::MIDItab_create(void)
32843284 setParam (ThreadSensitivity,(int )threadSensitivity6->getValue ()+0x50 );
32853285 fprintf (stderr," threadSensitivity1:%d\n " ,(int )threadSensitivity6->getValue ()+0x50 );
32863286 });
3287-
3287+
32883288}
32893289
32903290
@@ -3471,7 +3471,7 @@ void MidiPlugin::OpenMidiDevice(const std::string &DeviceName,snd_rawmidi_t *&in
34713471 return ;
34723472 }
34733473 do {
3474-
3474+
34753475 snd_ctl_t *ctl;
34763476 char devName[128 ];
34773477 int device;
@@ -3531,7 +3531,7 @@ void MidiPlugin::OpenMidiDevice(const std::string &DeviceName,snd_rawmidi_t *&in
35313531 sub_name = snd_rawmidi_info_get_subdevice_name (info);
35323532 if (DeviceName == name)
35333533 {
3534-
3534+
35353535 sprintf (devName, " hw:%d,%d" , card, device);
35363536 if ((err = snd_rawmidi_open (&inputp, &outputp, devName, SND_RAWMIDI_NONBLOCK )) < 0 ) {
35373537 error (" cannot open port \" %s\" : %s" , devName, snd_strerror (err));
@@ -3550,7 +3550,7 @@ void MidiPlugin::OpenMidiDevice(const std::string &DeviceName,snd_rawmidi_t *&in
35503550 sprintf (devName, " hw:%d,%d,%d" , card, device, sub);
35513551 if ((err = snd_rawmidi_open (&inputp, &outputp, devName, SND_RAWMIDI_NONBLOCK )) < 0 ) {
35523552 error (" cannot open port \" %s\" : %s" , devName, snd_strerror (err));
3553-
3553+
35543554 }
35553555 if ((err = snd_rawmidi_nonblock (inputp, 1 )) < 0 ) {
35563556 error (" cannot set nonblocking mode: %s" , snd_strerror (err));
@@ -3563,7 +3563,7 @@ void MidiPlugin::OpenMidiDevice(const std::string &DeviceName,snd_rawmidi_t *&in
35633563 }
35643564 }
35653565 snd_ctl_close (ctl);
3566-
3566+
35673567 if ((err = snd_card_next (&card)) < 0 ) {
35683568 error (" cannot determine card number: %s" , snd_strerror (err));
35693569 break ;
@@ -3688,9 +3688,5 @@ void MidiPlugin::error(const char *format, ...)
36883688 va_end (ap);
36893689 putc (' \n ' , stderr);
36903690}
3691- FunctionInfo::FunctionInfo ()
3692- {
3693-
3694- }
36953691
36963692#endif
0 commit comments