Audio::WAV on win 32

2013-04-18 Thread Spencer Chase
I am trying to read the raw data from a WAV file that I am using for 
storing data logger information. Using a test WAV file with nothing but 
silence, I do not get the expected all 0 results. I have tried different 
unpack formats but nothing seems to work any better. My test files are 
made in Audacity using the generate silence function. I am testing 
with mono files so there should just be a series of 16 bit signed 
integers. The dumped data shows that Audio::WAV sees the file as mono 
with the correct sample rate and bit depth. All suggestions welcomed.

use strict;
use Audio::Wav;
use Cwd;
use Data::Dumper;

my $path = getcwd;
my $wav = new Audio::Wav;
my $test = 'test.wav';
my $read = $wav - read($test);

my $details = $read - details();
print Data::Dumper-Dump([ $details ]);

my $total = 0;
my $buffer = 2;
my $length = $read - length();
while ( $total  $length ) {
$total += $buffer;
my $data = $read - read_raw( $buffer );
my $value = unpack('s',$data);
my $sample = $total/2;
print \nsample $sample value $value ;
}

-- 
Best regards, Spencer Chase
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356
(425) 791-0309

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


syllable phonology

2011-09-24 Thread Spencer Chase
does anyone have a perl script that i can use as an example to create 
syllables from an input word using the syllable module from Linuga 
Phoinology. the synopsis in the module documentation is not a complete 
working example and i can not find one anywhere online. this is for use 
on a windows computer so i am asking here.

-- 
Best regards, Spencer Chase
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356
(425) 791-0309

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: win 32 sound problem or ???

2011-02-27 Thread Spencer Chase
the script i sent in last message has a couple of errors that make the 
sound it produces inaudible for testing.

the corrected script follows:

use strict;
use Win32::Sound;
my $input = 1;
my $repeats;
my $data;
while ($input){
 print \nenter number of repetitions of pulse \enter\ to quit.\n;
 $input=STDIN;
 chomp $input;
 $repeats = $input;
 do_it();
}
sub do_it{
my $WAV = new Win32::Sound::WaveOut(44100, 8, 2);
 my $data;
my $counter;
my $increment =  1000/44100;
 my $repeat_width = int((44100 / 1000) * (20));
 my $pulse_width = int((44100 / 100) * (1/ 2)); 
 my $space = $repeat_width - $pulse_width;
  print \nrepeats $repeats width $pulse_width space $space\n;
 for ( my $i = 0 ; $i  $repeats ; $i++ ) { # for number of repeats, make 
pulse and space
for ( my $j = 0 ; $j  $pulse_width ; $j++ ){ # do the pulse
my $v;
 $v = sin($counter/2*3.14) * 128 + 128;  # for sine wave
 #$v = 255;
$data .= pack(cc, $v, $v);# pack it twice for 
left and right
 $counter += $increment;
 }  
 for ( my $k = 0 ; $k  $space ; $k++ ){ # do the space between pulses
 my $v = 127;
 $data .= pack(cc, $v, $v);
 }
 }
$WAV-Unload();  # drop it
 $WAV-Load($data);   # get it
 $WAV-Write();   # hear it
 1 until $WAV-Status();  # wait for completion
 $WAV-Save(test.wav); # write to disk
 $WAV-Unload();  # drop it
}



-- 
Best regards, Spencer Chase
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356
(425) 791-0309

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


win 32 sound problem or ???

2011-02-26 Thread Spencer Chase
i have the following script that is part of a larger tk script to make 
wav files of various pulses. i have replaced most variables with 
constants to make it simpler. added added a few comments to make a 
little sense out of what it does but the main question is the following: 
the number of repetitions can be increased by entering higher numbers 
but the number of repetitions can never be made smaller. try entering a 
lower repetition number after entering a higher number and see that it 
still does the higher number of repeats. $data should be reset each 
time? this must be something stupid i am doing but it is so simple and i 
can't figure it out?

use strict;
use Win32::Sound;
my $repeats = 1;
while ($repeats){
 print \nenter number of repetitions of pulse \enter\ to quit.\n;
 $repeats= STDIN;
 chomp $repeats;
 do_it();
}
sub do_it{
 my $WAV = new Win32::Sound::WaveOut(44100, 8, 2);
 my $data;
 my $counter;
 my $increment = int (1/44100);
 my $repeat_width = int((44100 / 1000) * (200));
 my $pulse_width = int((44100 / 100) * (1000 / 2));
 my $space = $repeat_width - $pulse_width;
 for ( my $i = 0 ; $i  $repeats ; $i++ ) { # for number of repeats, 
make pulse and space
 for ( my $j = 0 ; $j  $pulse_width ; $j++ ){ # do the pulse
 my $v;
 $v = sin($counter/2*3.14) * 128 + 128;  # for sine wave
 $data .= pack(cc, $v, $v);# pack it twice for left 
and right
 $counter += $increment;
 }
 for ( my $k = 0 ; $k  $space ; $k++ ){ # do the space between pulses
 my $v = 127;
 $data .= pack(cc, $v, $v);
 }
 }
 $WAV-Unload();  # drop it
 $WAV-Load($data);   # get it
 $WAV-Write();   # hear it
 1 until $WAV-Status();  # wait for completion
 $WAV-Save(test.wav); # write to disk
 $WAV-Unload();  # drop it

-- 
Best regards, Spencer Chase
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356
(425) 791-0309

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Komodo in Win XP mode

2011-02-04 Thread Spencer Chase
I  can not get many things to work in Windows 7 64 bit when using PDK 
and Komodo. I decided to try installing XP mode so I don't have to 
reboot to my 32 bit partition or run another computer just to maintain  
scripts that use incompatible modules. I was able to install various 
active perls as well as PDK but I can not get Komodo to work at all. It 
will not open. I have installed it from an msi downloaded and copied 
within the XP mode file system.

This is the only reason I bought XP mode and am feeling a little ripped 
off as I always do when I buy something from

-- 
Best regards, Spencer Chase
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356
(425) 791-0309

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


perlapp on win 7 64 bit?

2010-12-22 Thread Spencer Chase
I am trying to make exe files for win32 systems on my 64 bit 
installation. I can run the scripts with all the needed modules using 
Komodo but I can not make exes that include the required perl 5.8. These 
scripts need perl 5.8 but it is not binary compatible with 64 bit 
windows. This is the error message I get if I try to change the source 
for perl in the main perlapp window. Any way to get around this other 
than running perlapp from the 32 bit installation which requires rebooting.

-- 
Best regards, Spencer Chase
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356
(425) 791-0309

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Where's Tk?

2010-12-16 Thread Spencer Chase
TK has been gone for a while now. TKX is a lot better for new 
applications but converting old scripts is a lot of work for anything 
not short and simple. I have to maintain duplicate installations to be 
able to maintain my old TK stuff and it is a real challenge to keep 
everything working. Every time I upgrade perl I cringe with the 
anticipation of what will no longer work.

I do understand that it is a good idea to upgrade to TKX but I have 
dozens of old applications that need occasional attention and are not 
worth the conversion to TKX. I would love to see good old TK back again.

On 12/16/2010 5:02 AM, Brian Raven wrote:
 I have Activestate Perl 5.12.2 (build 1202) installed. I can see some Tk
 extension packages in the PPM gui, but no sign of Tk itself.

 Is there a problem, or is just me looking in the wrong place?



-- 
Best regards, Spencer Chase
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356
(425) 791-0309

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


supporting old perls

2010-10-07 Thread Spencer Chase
  I have a number of old scripts that I occasionally need to maintain. I 
am using Komodo IDE and a recent version of Perl. These old scripts us 
TK, but TK has been eliminated in the newer versions of Perl. Other than 
keeping a separate computer with an old perl installed, is there any way 
to easily have both new and old and switch between them? It would be 
great if Komodo had an option to use a particular Perl on a project but 
I don't think there is such an option. I am using TKX for new scripts 
but these old ones are quite large and would require a lot of work to 
convert.  Any other options specifically with respect to TK? I tried 
adding it to my site lib but there are a lot of includes and requires 
that would be a big job to locate and install. Hoping for an easy solution.

-- 
Best regards, Spencer Chase
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356
(707) 972-3149

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: ActiveState - how times have changed

2010-08-24 Thread Spencer Chase
  I don't understand this thread. Active state still has low cost single 
user licenses for both Komodo and PDK and upgrades similarly priced. 
sure upgrades are now $145 instead of $100 but what hasn't increased in 
cost in the past 5 years so? bought a tomato lately?

On 8/24/2010 6:27 AM, Dennis Daupert wrote:
 You might want to have a look at Padre, The Perl IDE:

 http://padre.perlide.org/

 There are installer binaries that will install both Strawberry
 and Padre. It's completely open source.

 best,

   /dennis

 
 Dennis Daupert, PhD
 Senior Systems Development Professional -- CSC Account
 CSC

 GOS | o: 1.317.298.9499 | ddaup...@csc.com | www.csc.com

 This is a PRIVATE message. If you are not the intended recipient, please
 delete without copying and kindly advise us by e-mail of the mistake in
 delivery.
 NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
 any order or other contract unless pursuant to explicit written agreement
 or government initiative expressly permitting the use of e-mail for such
 purpose.



From:   David Kaufmanda...@gigawatt.com

To: perl-win32-users@listserv.ActiveState.com

Date:   08/23/2010 11:32 PM

Subject:Re: ActiveState - how times have changed






 Hi Chris,

 Wow -- how unbelievably sad! :-(

 I've upgraded my PDK licenses 4 or 5 times for under $100.  I guess this
 is ActiveState's way of telling us that they're no longer interested in
 small time customers like us any more.

 Oh well, this was just the motivation I needed to dive headlong into
 Strawberry Perl and PAR.

 -dave



 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

-- 
Best regards, Spencer Chase
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356
(707) 972-3149

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Tkx vs. Tcl Dev Kit

2010-05-31 Thread Spencer Chase
Greetings Kanhaiya,

At Jan's recommendation, I made the switch to TKx for my PerlApp
executables. I was previously using Perl TK but I needed to make apps
for the Mac using PerlApp on a windows computer. It was a lot of work
and I only have converted a few scripts so far but everything works
perfectly. One script uses just about everything TKx has to offer.TKx
is perfectly compatible with ActivePerl and PerlApp.

Documentation is a little light on TKX although there is one online
tutorial that is very helpful that jan recommended.
http://www.tkdocs.com/tutorial/index.html

Monday, May 31, 2010, 6:51:39 AM, you wrote: K Whic one is better for GUI 
based perl application?
K  
K Perl Tkx 
K OR
K ActiveTcl with Tcl Dev Kit
K  
K I'm confused and not finding any solution.
K  
K Kanhaiya Prasad
K  
K  
K  
 

-- Best regards,
 mailto:spen...@spencerserolls.com 
67550 Bell Springs Rd. 
Garberville,CA 95542 Postal service only. 
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com 
http://www.spencerserolls.com 
(707) 984-8356 
(707) 972-3149

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


extract nested zip file

2010-05-17 Thread Spencer Chase
Greetings Perl-win32-users,

 I don't know if the program I am going to suggest will specificlly
 deal with the nesting in the way you like  but it is a good program
 and you can certainly find docs online. It is very powerful flexible
 and pretty easy to use. I run the command line version from perl
 scripts to do things that CPAN modules can't. http://www.7-zip.org/
 Does LZMA. Open source so...

 
 Could anyone tell me that how to extract nested zip file, i.e.,
 abc.zip contains another zip file
 named xyz.zip.
 My requirement is to not to extract parent zip (abc.zip) but
 directly extract child zip 'xyz.zip. 
 
 I have never tried anything like that myself, but the obvious (to
 me) guess for a place to start would be a module that specialises in
 zip files like Archive::Zip, possibly in combination with
 Archive::Zip::MemberRead.

-- Best regards, Spencer Chase mailto:spen...@spencerserolls.com
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356 
(707) 972-3149

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


clipboard and macos

2010-05-09 Thread Spencer Chase
Greetings,

sorry for posting to a bunch of lists, some of which i may not be
subscribed to. please write to me directly since i forget which lists
i am receiving.

i have spent the entire day trying to figure out how to copy to the
system clipboard on the Mac OSX (darwin) non of the CPAN modules seems
to work for darwin. i have tried clipboard which is supposed to work
with most OSs but i get all sorts of errors that i have not been able
to resolve in hours and hours of attempts. i am just trying to use the
example code in the clipboard module which works fine for win32 but
nothing i can modify in the module gets it to work on Mac OSX.

i have also tried mac pasteboard but there is not PPM for it and i
could not get it installed myself.

anything else that might work? i am using TKx and need to copy from an
entry widget to other applications. no problems copying and pasting
with the app, it is the system clipboard that i need to copy to.

-- Best regards, Spencer Chase mailto:spen...@spencerserolls.com
67550-Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
(707) 984-8356 
(707) 972-3149

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


TK question

2009-09-18 Thread Spencer Chase
Greetings Perl-Win32-Users,

I have been trying everything I can think of and nothing works. I have a TK 
application that uses getopenfile. The problem is that you can select a file in 
the browser window by either clicking the file and then clicking open or you 
can double click the file and not have to click open. This is fine but if the 
browser window happens to be over another widget, the second click seems to 
select something in that widget. In my case, that widget is s scrolled listbox. 
I do not want to change the selection accidentally. I have tried everything I 
can think of to lock the listbox but nothing works. A button to lock the 
listbox would be fine but I can't figure out how to do it. Disabling a double 
click in the getopenfile browser would also be fine but can't find a way to do 
that either. Open to any and all suggestions.

--
Best regards,
Spencer Chasemailto:spen...@spencerserolls.com
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Perl Tk system button

2009-09-11 Thread Spencer Chase
Greetings Geoff,

Searching the perl install folder for images, I come up with Tk.xpm in 
perl/lib/tk which looks exactly like the re Tk my guess is that you can change 
this to another xpm and give it the same name if you don't want to find in 
which code the image is referenced to change it. good luck finding an image 
editor that can save in xpm format. let me know if you find one as I have 
wanted to do the same thing.

Friday, September 11, 2009, 3:02:46 PM, you wrote:

Is it possible to change the image in the system menu button (The red Tk button 
in the top left hand corner of all GUI windows)? I would like to add my own 
icon in place of this symbol.
 
Cheers
 
Geoff
 


-- 
Best regards,
Spencer Chasemailto:spen...@spencerserolls.com
67550 Bell Springs Rd.
Garberville,  CA 95542Postal service only.
Laytonville, CA 95454UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


running a dos program from perl

2009-03-31 Thread Spencer Chase
Greetings Perl-win32-users,

I need to run a dos program with parameters about 1500 times with different 
parameter sets. I have a perl script that creates batch files with the program 
call and parameters and these work fine. I am trying to find a way to 
automatically run all the batch files. The dos program also requires 
confirmation from the keyboard 7 time to run to completion. If I run the 
program from a batch file I just need to hit enter 7 times before the first 
one is needed and the program runs to completion so the keystrokes are buffered 
and used by the program appropriately. 

Is there any way to run this program from perl and have the perl script supply 
the 7 required enters? I don't understand enough about threads and processes to 
figure out how this might be done. I have tried calling the batch files using 
system, backticks and system and can not get even close. 

--
Best regards,
Spencer Chasemailto:spen...@spencerserolls.com
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
spen...@spencerserolls.com
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


problem with Komodo

2008-09-12 Thread Spencer Chase


Greetings Perl-win32-users,

not sure which address is registered with Activestate so I am trying a few. 
please forgive multiple submissions

not sure what the best list might be but this is a problem on win 32 so...

I have been having computer problems with updates and had to do system restore 
etc after which my Komodo does not run any scripts that use the file browsing 
method of the following. If I compile the script into an exe with PerlApp 
they all work fine. Running in the debugger in Komodo, clicking the button in 
this sample terminates the script instead of opening the file browser. This has 
happened at a most unfortunate time, just prior to a demonstration. I can hard 
code sample files and avoid the browser but I really need to get this working 
again ASAP. I have no idea what options or environment variables might have 
changed. Re-installing Komodo has not fixed the problem. If there is a more 
appropriate forum, please suggest one.


use strict;
use Tk;
my $maintitle = TEST;
my$backcolor = #DCA5FF;

my $mw = MainWindow-new(
-background= $backcolor,
-borderwidth=4,
-relief='ridge');

$mw- title ($maintitle);

my $frame3= $mw- Frame(-background= $backcolor)-pack();

my $singlefileetc = $frame3- Frame(-width=60,  
-bd=2)-pack(-side='right',-padx= 0);

my $onefile = $singlefileetc- Button (
-text = Process Single File, -command =sub {
   my $singlefile = $singlefileetc- getOpenFile(
   -initialdir='') ;
wreck_file($singlefile) if defined $singlefile;# in case it is cancelled
   },
-activebackground='green',
-background='yellow') -pack (-side='left');

sub wreck_file {
my $file = shift;
print \nfile is $file;
}   

MainLoop;



--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


perl 5.8 and TK

2008-06-19 Thread Spencer Chase
Greetings 'perl-win32-users',

I have a bunch of old scripts that use TK and have noticed that old scripts 
that worked with perl 5.6 often do not work with 5.8. It seems that some syntax 
sloppiness that was allowed in 5.6 is not longer allowed in 5.8 and that some 
options for widgets are no longer valid. 

Is there a reference anywhere that lists the changes? 

--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


perl tray

2008-04-03 Thread Spencer Chase
Greetings Jan,

My interest was provoked by the discussion of perl tray so I thought I would 
see what it did since I have had it in dev kit for years. I installed slash 
tray as a test not having read the script. How do I get rid of it? I don't want 
to learn all about perl tray unless i really need it but am not amused by the 
constant pop ups.

--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: PerlTK: Window Always on Top

2008-02-26 Thread Spencer Chase
Greetings Daniel,

you need to use the StayOnTop module. It is not included in the stock 
distribution so you need to PPM it or download and install it. I think it is an 
easy one to install. Here is a test script that seems to work.


use strict;
use Tk;
use Tk::StayOnTop;

my $on_top = 0;
my $maintitle = Test Stay On Top;
my $backcolor = #DCA5FF;

my $mw = MainWindow-new(
-background= $backcolor,
-borderwidth=4,
-relief='ridge');
$mw- title ($maintitle);

my $bodytext_font = $mw-fontCreate(-family=times,-size = 14);

my $canvas = $mw-Scrolled('Canvas',-height = 100, -width =200)-pack();
my $c = $canvas- Subwidget(canvas);

my $bttn = $c- Button(-text = On Top, -background='pink', -command = 
\on_top);
my $id = $c- createWindow(100, 75, -window = $bttn);

sub on_top{
if ($on_top == 0){
$on_top = 1;
$mw-stayOnTop;
$mw-update;
}
else {
$on_top = 0;
$mw-dontStayOnTop;
$mw-update;
}
}
MainLoop;


Tuesday, February 26, 2008, 6:22:36 AM, you wrote:
DB Hi,

DB I have an application wherein it calls a tk window asking the user
DB to fill a form.

DB I need this tk window to be always on top. how do i do it with TK?

DB Or do I use a separate module for doing this (GUITest)?

DB Dan


-- 
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville,  CA 95542Postal service only.
Laytonville, CA 95454UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


perl is confused after upgrade

2008-02-18 Thread Spencer Chase
Greetings Perl-win32-users,

I get the following message when trying to install a module. I have no idea 
what this conflict means or how to resolve it. Ideas please? This is a fatal 
error because make is not made. I am also having other strange problems with 
perl so maybe this is an indication as to what is wrong.

Your perl and your Config.pm seem to have different ideas about the 
architecture they are running on. Perl thinks: [lib] Config says: 
[MSWWin32-x86-multi-thread] This may or may not cause problems. Please check 
your installation of perl if you have problems building this extension.

--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


requires and includes all screwed up

2008-02-12 Thread Spencer Chase

Greetings Perl-win32-users,

Sorry if you get this twice. Sent it from one e-mail account that I must not 
have used for membership.

I have installed perl 5.8.8 and possibly an update to Komodo IDE recently. I 
have not been using scripts with installed modules for a while so I don't know 
at what point all hell started. Scripts that have worked for years suddenly 
fail in require and include errors. I have used PPM to verify installations 
where I can and find no problems even though the scripts will not work. An 
example is an error re a require for win32 process which is part of libwin and 
is verified as OK by PPM. I have fiddled with adding additional paths to the 
list in Komodo but can only make things worse. Any idea what I might have 
screwed up by upgrading? How about a tutorial that might help me find why 
Komodo and PerlAPP 7 can suddenly not find anything outside of basic scripts? 
Where exactly is the include file or whatever tells perl komodo and perlapp 
where to look? I think it might be totally screwed up since PPM says that 
things are there but nothing can find them.

--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Term::ReadKey does not work with TK?

2008-01-27 Thread Spencer Chase
Greetings Daniel,

I use the following little sub to get keypresses in TK.

sub get_key{
my ($widget) = @_;
my $e = $widget-XEvent;# get event object
my $key_num = $e-N;
}

Sunday, January 27, 2008, 6:37:11 AM, you wrote:
DB Hi,

DB I just realized Term::ReadKey does not work with TK, or is it?

DB Is there any way for me to read keypresses from TK?
DB My TK application is mostly a Canvasand I need to plot/draw the
DB keypressed characters directly into this canvas.

DB Thus far the solution I am using is IsKeyPressed (Win32::GuiTest) but this 
does
DB not probe to be efficient and likewise, I found a bug with IsKeyPressed
DB and SendRawKey


DB Any help is appreciated.

DB Dan
-- 
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville,  CA 95542Postal service only.
Laytonville, CA 95454UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


win32::process problem

2007-11-29 Thread Spencer Chase
Greetings ,

I know that everyone likes a working or not working total script. In this case 
it is not
going to be easy for someone else to test so I will start with just a snip and 
try to
explain the problem. I can send a whole script but it would require installing 
programs
and text files etc. to really test it. I will send the mess of a script (I tend 
to write
really rambling garbage with the hope of cleaning it up some day and rarely do) 
to anyone
who does want to install the required program etc.

 Win32::Process::Create( my $process,
$player,
$play_file,
0,
DETACHED_PROCESS,
.) || die Create: $!;

I am using win32::process as above. I need to start an application that, 
unfortunately is
in the following location:
C:\Program Files\vanBasco's Karaoke Player\vmidi.exe  It has both a ' and 
spaces in it so
I can not figure out how to treat it in  or '' strings. I read the path from 
a text file
just as it is above and assign this to the variable $player the other variable 
$play_file
is a MIDI file that the application will open and is in the working directory 
although it
can also have a path added to it. The above snip of code works fine on one 
computer (the
one I am developing it on) but not on another win xp machine. I get an error 
from die
since the process can not be created. I have tried all sorts of combinations of 
 ''
single and double \\ / \' for the ' in the path, thinking that I might get 
something that
works on both computers. I can only get it to work by reading C:\Program 
Files\vanBasco's
Karaoke Player\vmidi.exe from a text file (a config file) and assigning it to 
$player.It
may also be that permission is needed to start a process but I thought I was 
avoiding this
by using win32::process.

Should the name of the process as used above work on all win computers? It it 
just a
permission problem? If so, what can I do to assure that I can run this 
application on
other computers not knowing what permissions and passwords are in effect?

--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: TK question

2007-09-07 Thread Spencer Chase
Greetings Don,

you can use Tk::ProgressBar; if you can count the total number of
files. then advance the bar as you increment a counter of files done.
that way, you can let TK do all the hard stuff.

Friday, September 7, 2007, 7:44:30 AM, you wrote:
DV I have a small app for windows that uses TK to display a menu.  Mostly
DV copied out of the book.  Each button calls a subroutine.  One of the 
DV buttons copies some large files.  This all works fine.  I need to add 
DV something to let the user know the copy process is in progress.  My 
DV first thought is to pop open a second window with a copy in progress
DV message in a flashing color.  Then when the main routine finishes with
DV the copy, close the second message window.  Can I do this?  Do I need to
DV fork off a process?

DV Would something else do the same type thing and be better/easier?

DV Thanks,
DV Don
DV ___
DV Perl-Win32-Users mailing list
DV Perl-Win32-Users@listserv.ActiveState.com
DV To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


-- 
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville,  CA 95542Postal service only.
Laytonville, CA 95454UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


stayOnTop?????????

2007-09-05 Thread Spencer Chase
Greetings perl-win32-users,

Not sure what group to post this to so I am trying this one first.

I have a perl TK script that uses StayOnTop. It works fine when I run
it from Komodo but when I try to make an exe with PerlApp, it does not
work. I have installed StayOnTop with the graphical PPM and the module
is in site\lib\tk as expected. When I test from perlapp, I get the
error message listed below. I have also pasted the relevant portion of
StayOnTop.pm.

Bareword found where operator expected at
/D:\Perl\program_changer.exeTk/StayOnTop.pm line 107, near case
METHOD_ATTRIB (Do you need to predeclare case?) syntax error
at /D:\Perl\program_changer.exeTk/StayOnTop.pm line 99, near ) {
syntax error at /D:\Perl\program_changer.exeTk/StayOnTop.pm line
107, near case METHOD_ATTRIB  Global symbol $obj requires explicit
package name at /D:\Perl\program_changer.exeTk/StayOnTop.pm line
108. BEGIN failed--compilation aborted at program_changer.pl line 6.

ub stayOnTop {
my ($obj) = @_;

$method ||=  $obj-get_method;
#warn Chosen method is $method;

switch ($method) {

case METHOD_WINAPI {
$obj-update;
# HWND_TOPMOST (-1) and SWP_NOSIZE+SWP_NOMOVE (3)
$win32_winpos-Call(hex($obj-frame()),-1,0,0,0,0,3);
}

case METHOD_ATTRIB {
$obj-attributes(-topmost = 1);
}

case METHOD_WMSTATE {
my($wrapper) = $obj-toplevel-wrapper;
$obj-property('set', '_NET_WM_STATE', ATOM, 32,
[_NET_WM_STATE_STAYS_ON_TOP], $wrapper);
}

case METHOD_SIMPLE {
my $stay_above_after;
$obj-bind(Visibility = sub {
if ($repeat_id) {
$obj-deiconify;
$obj-raise;
}
});
$repeat_id = $obj-repeat(1000, sub {
$obj-deiconify;
$obj-raise;
undef $stay_above_after;
}) unless defined $repeat_id;

}

else {
die Invalid method type [$method];
}
}
}


--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


tk stay on top problem with perlapp for win32

2007-09-05 Thread Spencer Chase
Greetings perl-win32-users,

Providing a script the demonstrates the problem as per $Bill's
suggestion. The script runs fine but fails with the above listed error
message when I try to make an exe with parlapp. Here is the script.
The error messages and portion of stayOnTop that the errors refer to
are copied again below.

use strict;
use Tk;
use Tk::StayOnTop;

my $on_top = 0;
my $maintitle = Test Stay On Top;
my $backcolor = #DCA5FF;

my $mw = MainWindow-new(
-background= $backcolor,
-borderwidth=4,
-relief='ridge');
$mw- title ($maintitle);

my $bodytext_font = $mw-fontCreate(-family=times,-size = 14);

my $canvas = $mw-Scrolled('Canvas',-height = 100, -width =200)-pack();
my $c = $canvas- Subwidget(canvas);

my $bttn = $c- Button(-text = On Top, -background='pink', -command = 
\on_top);
my $id = $c- createWindow(100, 75, -window = $bttn);

sub on_top{
if ($on_top == 0){
$on_top = 1;
$mw-stayOnTop;
$mw-update;
}
else {
$on_top = 0;
$mw-dontStayOnTop;
$mw-update;
}
}
MainLoop;

 Not sure what group to post this to so I am trying this one first.
 
 I have a perl TK script that uses StayOnTop. It works fine when I run
 it from Komodo but when I try to make an exe with PerlApp, it does not
 work. I have installed StayOnTop with the graphical PPM and the module
 is in site\lib\tk as expected. When I test from perlapp, I get the
 error message listed below. I have also pasted the relevant portion of
 StayOnTop.pm.
 
 Bareword found where operator expected at
 /D:\Perl\program_changer.exeTk/StayOnTop.pm line 107, near case
 METHOD_ATTRIB (Do you need to predeclare case?) syntax error
 at /D:\Perl\program_changer.exeTk/StayOnTop.pm line 99, near ) {
 syntax error at /D:\Perl\program_changer.exeTk/StayOnTop.pm line
 107, near case METHOD_ATTRIB  Global symbol $obj requires explicit
 package name at /D:\Perl\program_changer.exeTk/StayOnTop.pm line
 108. BEGIN failed--compilation aborted at program_changer.pl line 6.

You need to supply the smallest *complete* script that you can that
reproduces your problem.  Nobody can run what you posted in it's current
form.  Strip your script down to something simple that fails like your
current script does - then run it to make sure it reproduces the problem
correctly and cut-n-paste it here.

 Not sure what group to post this to so I am trying this one
Re  first.
   I have a perl TK script that uses StayOnTop. It works fine when I
run  it from Komodo but when I try to make an exe with PerlApp, it
does not  work. I have installed StayOnTop with the graphical PPM and
the module  is in site\lib\tk as expected. When I test from perlapp,
I get the  error message listed below. I have also pasted the
relevant portion of  StayOnTop.pm.Bareword found where operator
expected at  /D:\Perl\program_changer.exeTk/StayOnTop.pm line 107,
near case  METHOD_ATTRIB (Do you need to predeclare case?)
syntax error  at /D:\Perl\program_changer.exeTk/StayOnTop.pm line
99, near ) {  syntax error at
/D:\Perl\program_changer.exeTk/StayOnTop.pm line  107, near case
METHOD_ATTRIB  Global symbol $obj requires explicit  package name
at /D:\Perl\program_changer.exeTk/StayOnTop.pm line  108. BEGIN
failed--compilation aborted at program_changer.pl line 6.

You need to supply the smallest *complete* script that you can that
reproduces your problem.  Nobody can run what you posted in it's current
form.  Strip your script down to something simple that fails like your
current script does - then run it to make sure it reproduces the problem
correctly and cut-n-paste it here.

--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


TK problem

2007-04-10 Thread Spencer Chase
Greetings perl-win32-users,

I really need to figure this out, I can not run any perl scripts on my
main computer that use TK.

Some how, I have gotten a mismatch between the TK object version and
$TK::XS. I have no idea what this XS stuff is. It seems to be called
by the dynaloader. All the copies of TK.pm that I have seems to set
the XS version as the same as the TK version. I had not changed
anything in Perl other than installing PDK 7 and Komodo 4 and do not
know when the problem started. I have tried uninstalling every
ActivePerl installation and starting over with  5.8.8 build 819 and
still have the problem. I tried installing PDK 7 on another computer
to see if I can duplicate the problem but the installation halts with
an error.

Is there any environment or other setting that PDK 7 might have
changed that could cause this?

I get the following error about a mismatch whenever I try to run a
script that uses TK.

Tk object version 804.027 does not match $Tk::XS_VERSION 800.024 at
C:/Perl/lib/ DynaLoader.pm line 253. Compilation failed in require at
D:\Perl\NOTE_L~1.PL line 3. BEGIN failed--compilation aborted at
D:\Perl\NOTE_L~1.PL line 3.


--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


TK problem

2007-04-08 Thread Spencer Chase
Greetings perl-win32-users,

I am using ActivePerl  perl5.8.8. PDK7 and Komodo 4.0

Suddenly, I have not been able to run scripts that use TK. I get the
following error:

 couldn't read bitmap file : No such file or directoryerror reading
 bitmap file  at C:/Perl/site/lib/Tk/Widget.pm line 196. at
 C:/Perl/site/lib/Tk/Widget.pm line 194

I also have the following strangeness using PerlApp 7 (or 6) I get
warnings that there are all kinds of duplicate files being skipped as
in the following:

Tk\prolog.ps:
error: Skipping duplicate file C:\Perl\lib\Tk\prolog.ps
refby: C:\Perl\site\lib\Tk.pm
file: C:\Perl\site\lib\Tk\prolog.ps
Tk\tranicon.gif:
error: Skipping duplicate file C:\Perl\lib\Tk\tranicon.gif
refby: C:\Perl\site\lib\Tk.pm

My guess is that some image file is missing, maybe this tranicon.gif
and that something else is very screwed up but I have no idea how to
fix it.

Do I just have to reinstall perl to fix this? Is it possible that
installing the PDK 7 might have caused this problem? I never had this
problem before installing PDK 7 and might not have tried any TK
programs until now.


--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


PDK beta

2007-03-27 Thread Spencer Chase
Greetings,

I have never figured out if there really is a PDK list or how to get
on it so I am writing to this group from which I do get e-mail.

I have been using the PerlApp-7 in the PDK beta and it suddenly
stopped working with an alert sound when I try to run it from a
shortcut. I have a license for PDK 6 and thought that PDK 7 wasn't
supposed to expire if there was a license. There is no error message
posted to tell me about a license or whatever. Has it expired and is
this the way it lets you know? Any other suggestions? The target
listed in the properties window of the shortcut shows an exe that I
can not find but the same is true of PDK 6 which does still work.


--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


audio questions

2007-02-19 Thread Spencer Chase
Greetings perl-win32-users,

The recent discussion of audio on the PC has me thinking again about
something I have been trying to do for years. I want to play MIDI
files from a perl TK script. I have checked out all of the modules
available on CPAN and nothing does what I want. There are issues with
selecting devices and a whole host of other problems. I have looked
briefly into using WIN32::API but trying to understand the terrible
documentation on Multimedia that Microsoft provides is more than I can
manage. I am hoping to find a module that allows me easy access to the
multimedia functions necessary to play MIDI files. If anyone has any
leads or code to share please let me know. Again, I have tried
everything on CPAN and some modules come close but not close enough.


-- Best regards, Spencer Chase mailto:[EMAIL PROTECTED]
67550 Bell Springs Rd. Garberville, CA 95542  Postal service only.
Laytonville, CA 95454 UPS only. [EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm (707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


setting registry values

2006-11-27 Thread Spencer Chase
Greetings perl-win32-users,

I have a script that uses media player (from CPAN) to play MIDI files
using mciSendString of the Win32 API. I have never been able to figure
out how to change the output device so I decided to use TieRegistry to
change the default MIDI output device. This works but changing the
value from the script does not have an immediate effect. In order for
the change of default devices to take effect, the script needs to
terminate. Using regedit I can see that the value is changing
immediately but the win 32 Media control interface does not see the
new default value until the script is run again. Is this normal
behavior with the registry and the MCI or is there some way to effect
an immediate update? Anything else in the script that might be
responsible for this behavior?

use strict;
use Win32::API;
use Win32::MediaPlayer; # this seems to come from D:\Perl\win32\
use Win32::TieRegistry;

my $path = 'C:/miditemp/01028e.mid'; # set to approp file

my @device_array = devnames();

my $index = 0;
foreach my $device (@device_array){
print $index $device\n;
$index ++;
}
print \nenter device number\n;
my $input = STDIN;
chomp $input;
my $valueDataString = $device_array[$input];
print\nSelected device is $valueDataString\n;

my $rk = 'CUser/Software/Microsoft/Windows/CurrentVersion/Multimedia/MIDIMap';
my $key = new Win32::TieRegistry $rk, {Access = 'KEY_ALL_ACCESS', Delimiter = 
'/' };

$key-SetValue( szPname, $valueDataString);
my $ValueData= $key-GetValue('szPname');
$key = undef;

my $winmm = new Win32::MediaPlayer; # new media player object
$winmm-load($path);# Load music file

my $total =$winmm-length(1);
print\ntotal length $total enter to continue\n;
$input = STDIN;

$winmm-play;   # Play the music
$winmm-seek(100);  # seek location in 
microseconds
$winmm-pause;  # Pause music playing
print \npaused enter to continue\n;
$input = STDIN;
$winmm-resume; # Resume music playing

my $pos = 0;# media player reports 
time in minutes and seconds so convert to seconds
my @t = split ':', $total;  # for the while loop
my $ntotal = $t[0] * 60 + $t[1];

while ($pos  $ntotal) {# print the time until file 
finishes
sleep .1;
$winmm-pos(1);
my $rpos = $winmm-pos(1);
my @p = split ':', $rpos;
$pos = $p[0] * 60 + $p[1];
printf \rNow Pos: %02u:%02u , int ($pos / 60), $pos % 60; # now time.
}

sub devnames {  # get device names from MCI
my @devices;
my $mognd = new Win32::API(winmm, midiOutGetNumDevs, , I);
unless ($mognd) {die error, midiOutGetNumDevs, $!; }
my $mognd_devices = $mognd-Call();
my $buf =   x 200;# no idea; size of 
returned data!?
my ($rtn, $i);
my $mogdc = new Win32::API(winmm, midiOutGetDevCaps, IPI, I);
unless ($mogdc) {die error, midiOutGetDevCaps, $!;}
for ($i = 0; $i  $mognd_devices; $i++) {
   $rtn = $mogdc-Call($i, $buf , 200);
   if ($rtn) {die midiOutGetDevCaps returned $rtn; }
   push(@devices, get_sz_at($buf, 8));
}
return @devices;
}

sub get_sz_at {
   my $s = substr $_[0], $_[1];
   substr($s, 0, index($s, \x0));
}

$winmm-close;

--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Parallel Port module

2006-10-20 Thread Spencer Chase
Greetings perl-win32-users,

I have gotten Scott Penrose's parallel port module to work on win32
and can set data bits reliably. I can not figure out any way to read
status bits from the port. The documentation is virtually lacking.
Methods for set_status and get_status are referenced but there is no
information as to how to use them. I have read the source code of all
of the parallel port modules and can not find clues anywhere. Does
anyone have any information on these methods or an example of how to
read the status and control bits?

--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


media player

2006-09-17 Thread Spencer Chase
Greetings perl-win32-users,

I have started fiddling with the Media Player module that has recently
become available on the CPAN site. I have no problem using it in
scripts to play MIDI files to the microsoft synth but my goal is to
play MIDI to external devices such as a USB MIDI interface. I have no
problem doing this with the help other modules, such as win32 MIDI
but it seems that Media Player is coded to only play audio. I am not
familiar with the win multimedia API and can not even guess what the
code of the Media Player module is doing. I am looking for a simple
solution to my need to play to other devices. I have written to the
author of the module but have received no reply.

--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs