简体   繁体   English

尝试使用OSC / UDP将seekBar的progressValue感知到服务器

[英]Trying to sen the progressValue of seekBar to server using OSC/UDP

So, I am trying to send the progressValue of a seekBar to a server using OSC. 因此,我正在尝试使用OSC将seekBar的progressValue发送到服务器。 However, I am not receiving any information on the server end. 但是,我没有在服务器端收到任何信息。

The connection works, as I have radio buttons that all register, and a player registration that also works. 连接有效,因为我有全部注册的单选按钮和也有效的播放器注册。 Can anyone check this code snippet and offer some advice? 谁能检查此代码段并提供一些建议?

 public void onProgressChanged(SeekBar seekbar, int progressValue,   boolean fromUser) {
      int step = 10;
        //  text = (TextView) findViewById(R.id.text);
        if(seekbar == Size) {
            progressValue = ((int) Math.round(progressValue / step)) * step;

            sz = progressValue;
            Size.setProgress(progressValue);
            text.setText(String.valueOf(progressValue));

            try{
            //This is where the value is being sent to the server    
            sender.send(new OSCMessage("/update_size", sz));
            }catch(Exception E){
                text.setText("Catch 3: "
                        + E.getClass().getName() + ", "
                        + E.getMessage());
            }
        }

There is an array method I had to use to pass floats or ints in the message. 我必须使用一种数组方法来在消息中传递浮点数或整数。 I got around this by passing it as a text value, then parsing it on the server. 我通过将其作为文本值传递,然后在服务器上对其进行解析来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM