remove inadvertently committed wine-unstable linkdir
[ardour.git] / libs / fst / vsti.c
index e5c7d9c6c978f2e5b69441967950196663919b99..a1a9a8be7263d9ffde9bcd3b4ffee0988974e92d 100644 (file)
@@ -1,10 +1,10 @@
 /*
  *   VST instrument support
  *
- *   Derived from code that was marked:    
+ *   Derived from code that was marked:
  *   Copyright (C) Kjetil S. Matheussen 2004 (k.s.matheussen@notam02.no)
  *   Alsa-seq midi-code made by looking at the jack-rack source made by Bob Ham.
- *    
+ *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
  *   the Free Software Foundation; either version 2 of the License, or
@@ -41,31 +41,31 @@ create_sequencer (const char* client_name, bool isinput)
 {
        snd_seq_t * seq;
        int err;
-       
+
        if ((err = snd_seq_open (&seq, "default", SND_SEQ_OPEN_DUPLEX, 0)) != 0) {
                fst_error ("Could not open ALSA sequencer, aborting\n\n%s\n\n"
-                          "Make sure you have configure ALSA properly and that\n"
-                          "/proc/asound/seq/clients exists and contains relevant\n"
-                          "devices (%s).", 
-                          snd_strerror (err));
+                          "Make sure you have configure ALSA properly and that\n"
+                          "/proc/asound/seq/clients exists and contains relevant\n"
+                          "devices (%s).",
+                               snd_strerror (err));
                return NULL;
        }
-       
+
        snd_seq_set_client_name (seq, client_name);
-       
+
        if ((err = snd_seq_create_simple_port (seq, isinput? "Input" : "Output",
-                                              (isinput? SND_SEQ_PORT_CAP_WRITE: SND_SEQ_PORT_CAP_READ)| SND_SEQ_PORT_CAP_DUPLEX |
-                                              SND_SEQ_PORT_CAP_SUBS_READ|SND_SEQ_PORT_CAP_SUBS_WRITE,
-                                              SND_SEQ_PORT_TYPE_APPLICATION|SND_SEQ_PORT_TYPE_SPECIFIC)) != 0) {
+                                       (isinput? SND_SEQ_PORT_CAP_WRITE: SND_SEQ_PORT_CAP_READ)| SND_SEQ_PORT_CAP_DUPLEX |
+                                       SND_SEQ_PORT_CAP_SUBS_READ|SND_SEQ_PORT_CAP_SUBS_WRITE,
+                                       SND_SEQ_PORT_TYPE_APPLICATION|SND_SEQ_PORT_TYPE_SPECIFIC)) != 0) {
                fst_error ("Could not create ALSA port: %s", snd_strerror (err));
                snd_seq_close(seq);
                return NULL;
        }
-       
+
        return seq;
 }
 
-static void 
+static void
 queue_midi (JackVST *jvst, int val1, int val2, int val3)
 {
        VstMidiEvent *pevent;
@@ -77,11 +77,11 @@ queue_midi (JackVST *jvst, int val1, int val2, int val3)
                fst_error ("event queue has no write space");
                return;
        }
-               
+
        pevent = (VstMidiEvent *) vec[0].buf;
 
        //  printf("note: %d\n",note);
-       
+
        pevent->type = kVstMidiType;
        pevent->byteSize = 24;
        pevent->deltaFrames = 0;
@@ -96,7 +96,7 @@ queue_midi (JackVST *jvst, int val1, int val2, int val3)
        pevent->midiData[1] = val2;
        pevent->midiData[2] = val3;
        pevent->midiData[3] = 0;
-       
+
        //printf("Sending: %x %x %x\n",val1,val2,val3);
 
        jack_ringbuffer_write_advance (jvst->event_queue, sizeof (VstMidiEvent));
@@ -113,8 +113,8 @@ void *midireceiver(void *arg)
 
        // Try to set fifo priority...
        // this works, if we are root or newe sched-cap manegment is used...
-       pthread_setschedparam( pthread_self(), SCHED_FIFO, &scp ); 
-       
+       pthread_setschedparam( pthread_self(), SCHED_FIFO, &scp );
+
        while (1) {
 
                snd_seq_event_input (jvst->seq, &event);
@@ -158,28 +158,28 @@ void *midireceiver(void *arg)
                        break;
                }
        }
-       
+
        return NULL;
 }
 
 void stop_midireceiver (JackVST *jvst)
 {
-       int err; 
+       int err;
        snd_seq_event_t event;
        snd_seq_t *seq2 = create_sequencer ("jfstquit", true);
-       
+
        jvst->midiquit = 1;
-       
+
        snd_seq_connect_to (seq2, 0, snd_seq_client_id (jvst->seq),0);
        snd_seq_ev_clear      (&event);
        snd_seq_ev_set_direct (&event);
        snd_seq_ev_set_subs   (&event);
        snd_seq_ev_set_source (&event, 0);
        snd_seq_ev_set_controller (&event,1,0x80,50);
-       
+
        if ((err = snd_seq_event_output (seq2, &event)) < 0) {
                fst_error ("cannot send stop event to midi thread: %s\n",
-                          snd_strerror (err));
+                               snd_strerror (err));
        }
 
        snd_seq_drain_output (seq2);