©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

Python and Wsurf Widget: Clearing the open file

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



Joined: 07 Jun 2004
Posts: 4

PostPosted: Thu Aug 05, 2004 11:40 pm    Post subject: Python and Wsurf Widget: Clearing the open file Reply with quote

I am attempting to program a "New" button in python that will clear the file loaded into the wsurf widget.

I've checked the commands listed in the developer manual both for the library and the widget itself - and can find nothing akin to "::wsurf::new" or "pathname new option" that I was sort of expecting - along the same vein of the other commands listed.

Does anyone have any suggestions?

Also, is there ever going to be an easier way to print than saving files as ghostscript files and opening them in ghostscript and printing?
Back to top
View users profile Send private message
kare



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

PostPosted: Tue Aug 10, 2004 2:25 pm    Post subject: Reply with quote

This is the first time anybody requested this function from Python, that's why id doesn't exist. Very simply to add, I'll do it when I get back from vacation.

Regarding printing, have you checked out the FAQ and sources. Would need some porting to Python of course... Maybe there's a Python way to print postscript? Will look into that a little, but not sure I have much time to make it work...

Kåre
Back to top
View users profile Send private message Visit posters website
busheyu



Joined: 07 Jun 2004
Posts: 4

PostPosted: Tue Aug 10, 2004 9:25 pm    Post subject: Adding 'new'... Reply with quote

That would be immensely awesome of you. Thank you so much!

I look forward to seeing the new feature.

I'm investigating postscript in python - doesn't look good. =( Oh well.

Thanks!

--uri
Back to top
View users profile Send private message
kare



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

PostPosted: Wed Aug 18, 2004 1:34 pm    Post subject: Reply with quote

I've added wsurf::new in the latest release

Kåre
Back to top
View users profile Send private message Visit posters website
urbushey
Guest





PostPosted: Thu Aug 19, 2004 4:44 pm    Post subject: Thank you Reply with quote

I will be checking out the "new" function today - that's awesome of you. Thanks so much!
Back to top
urbushey
Guest





PostPosted: Thu Aug 19, 2004 5:19 pm    Post subject: Woops Reply with quote

Erm, maybe I'm misunderstanding something or doing this incorrectly - but, shouldn't:

Code:
self.waveSurf1.new()
work?

I've tried that and:
Code:
self.waveSurf1.tk.call(wsurf::new)
to no avail.
With both, i get a traceback:

Code:
wavesurfer-1.7.1\python\Wsurf.py", line 131, in new
    self.tk.call(self._w, 'new')
TclError: invalid command name "wsurf::new".
Back to top
kare



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

PostPosted: Mon Aug 23, 2004 10:03 am    Post subject: Reply with quote

Here's an example script

from Tkinter import *
from Wsurf import *
root=Tk()
root.tk.eval('package require -exact wsurf 1.7')
ws=Wsurf(root)
ws.pack(expand='yes',fill='both')

ws.openFile('ex1.wav')

ws.new()


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