Host and client issue (WLAN)
This is probably/hopefully a quite small issue, as I'm a freshman and rather copy-and-pasted this code together:
-
import themidibus.*;
import processing.net.*;
import sures.remotevlc.*;
VlcConnection vlc; // Remote VLC
MidiBus myBus; // The MidiBus
boolean midiThru = false; // echo all received midi in messages to the midi out device
int maxNotes = 128;
int intt;
String temmp;
class Note {
long startTime;
float kMinVelocity = 0;
float kMaxVelocity = 127;
int pitch;
int velocity;
boolean isOn = false;
Note(int pitch) {
this.pitch = pitch;
}
void init(int pitch, int velocity)
{
startTime = millis();
this.pitch = pitch;
this.velocity = velocity;
this.isOn = true;
}
};
void setup() {
size(10,10);
vlc = new VlcConnection(this, "192.168.1.6", 8080);
MidiBus.list(); // List all available Midi devices on STDOUT. This will show each device's index and name.
// MODIFY THIS FOR YOUR MIDI SETUP
// Parent In Out
// | | |
myBus = new MidiBus(this, 0, -1); // Create a new MidiBus with Midi Yoke 1 as input device and no output device.
for (int i = 0; i < maxNotes; ++i) {
notes[i] = new Note(i);
}}
Note[] notes = new Note[128];
void draw() {
// draw nothing
}
void noteOn(int channel, int pitch, int velocity) {
// Receive a noteOn
println("Note On : ch=" +channel+" pitch="+pitch+" velocity="+velocity);
/* if (pitch == 65)
{
client.write("add take2.avi" +"\r\n");
client.clear();
}
*/
if (pitch == 66) vlc.play();
if (pitch == 67) vlc.pause();
if (pitch == 68) vlc.next();
if (pitch == 69) vlc.previous();
}
void noteOff(int channel, int pitch, int velocity) {
// Receive a noteOff
notes[pitch].isOn = false;
}
void controllerChange(int channel, int number, int value) {
// Receive a controllerChange
if (midiThru) {
myBus.sendControllerChange(channel, number, value); // Send a controllerChange
}
}
What I want:
Run VLC player on one laptop (laptop A). Controlling it by midi-messages with another laptop (laptop B) via wireless Ad-hoc network.
When I try it on one laptop only (with localhost:1234) the whole connection works.
What I do:
Run a processing-sketch on laptop B. The VlcConnection is defined as:
vlc = new VlcConnection(this, "IP-address-of-laptop-A", 8080);
I start VLC player with the windows command shell:
vlc file.ext --intf rc --rc-host IP-address-of-laptop-B:8080
I'm using VLC-player version 2.0.4. I also saved laptop B's IP-address (as IP-address/16) in the .host file which is located in the VLC subfolder (VLC/lua/http)
Issue:
VLC starts running but doesn't seem to receive the commands of laptop B.
There are a couple of things, which aren't really clear to me. For example this in:
vlc = new VlcConnection(this, "IP-address-of-laptop-A", 8080);
I assume the fault is somewhere around defining the client.
Can anyone help?
By the way, both laptops run with Windows XP. Firewalls and Virscan disabled.
Thank you!