[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] SF.net SVN: quarks:[1289] DataNetwork
Revision: 1289
http://quarks.svn.sourceforge.net/quarks/?rev=1289&view=rev
Author: nescivi
Date: 2009-12-17 00:04:51 +0000 (Thu, 17 Dec 2009)
Log Message:
-----------
bugfixes
Modified Paths:
--------------
DataNetwork/DataNetworkGUI.sc
DataNetwork/SWDataNetworkOSC.sc
DataNetwork/SWDataNetworkOSCGui.sc
Modified: DataNetwork/DataNetworkGUI.sc
===================================================================
--- DataNetwork/DataNetworkGUI.sc 2009-12-15 19:56:56 UTC (rev 1288)
+++ DataNetwork/DataNetworkGUI.sc 2009-12-17 00:04:51 UTC (rev 1289)
@@ -58,7 +58,7 @@
cw.background = Color.gray(0.8);
- GUI.staticText.new( cw, Rect( 0, 0, 20, 16 )).string_( slot.id[1].asString ).font_( font ).align_( \right );
+ GUI.staticText.new( cw, Rect( 0, 0, 25, 16 )).string_( slot.id[1].asString ).font_( font ).align_( \right );
key = GUI.textField.new( cw, Rect( 0, 0, 65, 16 )).string_( slot.key.asString ).action_( { |tf| slot.key = tf.value.asSymbol; editKey = false; } ).font_( font );
@@ -124,7 +124,7 @@
decorator.nextLine;
- slider = GUI.slider.new( cw, Rect( 0, 0, 205, 16 ) );
+ slider = GUI.slider.new( cw, Rect( 0, 0, 210, 16 ) );
this.addGetButton;
@@ -194,8 +194,8 @@
SWDataNodeGui{
classvar <>xposScreen=0, <>yposScreen=20, <>font;
- classvar <>xsize = 249;
- classvar <>xsizeBig = 207;
+ classvar <>xsize = 254;
+ classvar <>xsizeBig = 212;
classvar <slottype;
@@ -257,7 +257,7 @@
decorator = cw.decorator;
- GUI.staticText.new( cw, Rect( 0, 0, 20, 16 )).string_( node.id.asString ).font_( font ).align_( \right );
+ GUI.staticText.new( cw, Rect( 0, 0, 25, 16 )).string_( node.id.asString ).font_( font ).align_( \right );
key = GUI.textField.new( cw, Rect( 0, 0, 65, 16 )).string_( node.key.asString ).action_( { |tf| node.key = tf.value.asSymbol; editKey = false; } ).font_( font );
Modified: DataNetwork/SWDataNetworkOSC.sc
===================================================================
--- DataNetwork/SWDataNetworkOSC.sc 2009-12-15 19:56:56 UTC (rev 1288)
+++ DataNetwork/SWDataNetworkOSC.sc 2009-12-17 00:04:51 UTC (rev 1289)
@@ -516,25 +516,31 @@
}
welcomeClientBack{ |client|
+ // ("welcoming client back" + client.addr + client.key ).postln;
+ client.welcomeBack;
client.nodeSubs.do{ |it|
if ( network.nodes[it].notNil){
client.newNode( network.nodes[it] );
}
};
- client.welcomeBack;
+ client.setters.do{ |it|
+ // "it" is an instance of SWDataNode
+ setters.put( it.id, client.addr );
+ };
}
addClient{ |addr,name|
var there,newclient;
there = this.findClient( addr );
// there = clients.find( { |it| it.addr == addr } );
- // [addr,there].postln;
+ // [addr,there,name].postln;
- if ( there.isNil, {
- // see if the client exists in the library
+ if ( there.isNil, {
+ // no client had that IP and port before
+ // see if the client exists by name in the library
there = clientDictionary.at( name.asSymbol );
if ( there.notNil){
- // address may have changed
+ // address may have changed, so we reset it:
there.addr = addr;
clients = clients.add( there );
this.welcomeClientBack( there );
@@ -545,6 +551,7 @@
}{
if ( addr.port > 0){
+ // "new client".postln;
clientPorts.add( addr.port );
newclient = SWDataNetworkOSCClient.new( addr, name.asSymbol );
clients = clients.add( newclient );
@@ -557,7 +564,9 @@
};
};
},{
+ // "client had same ip and port, welcome back".postln;
there = clientDictionary.at( name.asSymbol );
+ // there.postln;
if ( there.notNil ){
this.welcomeClientBack( there );
this.logMsg( "client reregistered:"+(addr.asString.replace( "a NetAddr",""))+name );
@@ -1036,6 +1045,7 @@
}
welcomeBack{
+ // this.dump;
addr.sendMsg( '/registered', addr.port.asInteger, key.asString );
this.pong;
this.setterQuery;
@@ -1079,11 +1089,11 @@
unsubscribeAll{
- nodeSubs.do{ |it|
+ nodeSubs.copy.do{ |it|
this.unsubscribeNode( it );
};
- slotNodesSubs.do{ |it|
- slotSubs[it].do{ |jt|
+ slotNodesSubs.copy.do{ |it|
+ slotSubs[it].copy.do{ |jt|
this.unsubscribeSlot( it, jt );
}
};
Modified: DataNetwork/SWDataNetworkOSCGui.sc
===================================================================
--- DataNetwork/SWDataNetworkOSCGui.sc 2009-12-15 19:56:56 UTC (rev 1288)
+++ DataNetwork/SWDataNetworkOSCGui.sc 2009-12-17 00:04:51 UTC (rev 1289)
@@ -57,7 +57,7 @@
addrPort = GUI.staticText.new( cw, Rect( 0, 0, 40, 16 )).string_( client.addr.port.asString ).font_( font ).align_( \right );
- key = GUI.textField.new( cw, Rect( 0, 0, 50, 16 )).string_( client.key.asString ).action_( { |tf| client.key = tf.value.asSymbol; editKey = false; } ).font_( font );
+ key = GUI.textField.new( cw, Rect( 0, 0, 120, 16 )).string_( client.key.asString ).action_( { |tf| client.key = tf.value.asSymbol; editKey = false; } ).font_( font );
key.mouseDownAction = { editKey = editKey.not; };
@@ -199,7 +199,7 @@
restore = GUI.button.new( w, Rect( 0, 0, 55, 20 )).states_(
[ [ "restore", Color.blue ] ] ).action_( { network.restoreClients} ).mouseOverAction_({ this.setInfo( "restore client configuration") });
- info = GUI.staticText.new( w, Rect( 0, 0, 250, 16 )).align_( \center );
+ info = GUI.staticText.new( w, Rect( 0, 0, 240, 16 )).align_( \center );
w.view.decorator.nextLine;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/