©2003 Kåre Sjölander and Jonas Beskow
Introduction Download Documentation Links Forum
WaveSurfer user forum

FAQ  FAQ
Search  Search
Memberlist  Memberlist
Register  Register
Profile  Profile
Login  Login

pb with extended boundaries

 
Post new topic   Reply to topic    www.speech.kth.se/wavesurfer Forum Index -> WaveSurfer
View previous topic :: View next topic  
Author Message
edouard
Guest





PostPosted: Mon Jul 07, 2003 10:16 pm    Post subject: pb with extended boundaries Reply with quote

hi,

there is a problem with transcription plugin.
when "extend boundaries" option is enabled, boundary extensions don't disapear when transcription pane is deleted. I suggest to rewrite trans::paneDeleted function in transcription.plug that way :

Code:
proc trans::paneDeleted {w pane} {
upvar [namespace current]::${pane}::var v

foreach otherpane [$w _getPanes] {
  if {$pane == $otherpane} continue
  upvar wsurf::analysis::${otherpane}::var ov
  upvar wsurf::dataplot::${otherpane}::var dv
  if {$ov(drawWaveform) || $ov(drawSpectrogram) || $dv(drawDataPlot)} {
   set othercanvas [$otherpane canvas]
   $othercanvas delete tran$pane
  }
}

namespace delete [namespace current]::${pane}
}
Back to top
Guest






PostPosted: Tue Jul 08, 2003 5:52 pm    Post subject: Re: pb with extended boundaries Reply with quote

It seems to be not so straightforward. It is ok when a transcription pane is deleted manualy but an error occurs when widget is deleted.

first of all, call to [$w getPanes] returns too much panes (even the ones that are already deleted). We must change a little bit function wsurf::_delete and replace
Code:
foreach pane [_getPanes $w] {
  _callback $w paneDeletedProc $pane
}
by
Code:
while {[llength $d(panes)] != 0} {
  _callback $w paneDeletedProc [lindex $d(panes) 0]
  set d(panes) [lreplace $d(panes) 0 0]
}


then, canvas must be tested before use with a call to winfo exists
Code:
proc trans::paneDeleted {w pane} {
upvar [namespace current]::${pane}::var v

foreach otherpane [$w _getPanes] {
  if {$pane == $otherpane} continue
  upvar wsurf::analysis::${otherpane}::var ov
  upvar wsurf::dataplot::${otherpane}::var dv
  if {$ov(drawWaveform) || $ov(drawSpectrogram) || $dv(drawDataPlot)} {
   set othercanvas [$otherpane canvas]
  if {[winfo exists $othercanvas]} {
    $othercanvas delete tran$pane
   }
  }
}
namespace delete [namespace current]::${pane}
}
Back to top
kare



Joined: 16 Aug 2002
Posts: 371
Location: KTH, Centre for Speech Technology

PostPosted: Thu Aug 28, 2003 12:47 pm    Post subject: Reply with quote

Thanks for the code! It's been included in the upcoming release.

Kåre
Back to top
View users profile Send private message Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    www.speech.kth.se/wavesurfer Forum Index -> WaveSurfer All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.1 © 2001, 2002 phpBB Group