Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.9 KiB

  1. package Win32::Sound;
  2. #######################################################################
  3. #
  4. # Win32::Sound - Perl Module for Windows Sound Interaction
  5. # ^^^^^^^^^^^^^^^^
  6. # Version: 0.03 (08 Apr 1997)
  7. #
  8. #######################################################################
  9. require Exporter; # to export the constants to the main:: space
  10. require DynaLoader; # to dynuhlode the module.
  11. @ISA= qw( Exporter DynaLoader );
  12. @EXPORT = qw(
  13. SND_ASYNC
  14. SND_NODEFAULT
  15. SND_LOOP
  16. SND_NOSTOP
  17. );
  18. #######################################################################
  19. # This AUTOLOAD is used to 'autoload' constants from the constant()
  20. # XS function. If a constant is not found then control is passed
  21. # to the AUTOLOAD in AutoLoader.
  22. #
  23. sub AUTOLOAD {
  24. my($constname);
  25. ($constname = $AUTOLOAD) =~ s/.*:://;
  26. #reset $! to zero to reset any current errors.
  27. $!=0;
  28. my $val = constant($constname, @_ ? $_[0] : 0);
  29. if ($! != 0) {
  30. # [dada] This results in an ugly Autoloader error
  31. #if ($! =~ /Invalid/) {
  32. # $AutoLoader::AUTOLOAD = $AUTOLOAD;
  33. # goto &AutoLoader::AUTOLOAD;
  34. #} else {
  35. # [dada] ... I prefer this one :)
  36. ($pack, $file, $line) = caller;
  37. undef $pack; # [dada] and get rid of "used only once" warning...
  38. die "Win32::Sound::$constname is not defined, used at $file line $line.";
  39. #}
  40. }
  41. eval "sub $AUTOLOAD { $val }";
  42. goto &$AUTOLOAD;
  43. }
  44. #######################################################################
  45. # STATIC OBJECT PROPERTIES
  46. #
  47. $VERSION="0.03";
  48. undef unless $VERSION; # [dada] to avoid "possible typo" warning
  49. #######################################################################
  50. # dynamically load in the Sound.pll module.
  51. #
  52. bootstrap Win32::Sound;
  53. # Preloaded methods go here.
  54. #Currently Autoloading is not implemented in Perl for win32
  55. # Autoload methods go after __END__, and are processed by the autosplit program.
  56. 1;
  57. __END__