473,785 Members | 2,879 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pacemaker Winamp-Plugin code doesnt work in VB.NET

1 New Member
Hi!

I am trying to use the following code in a little VB.Net project and I just cant get it to work. I get an error that says the "adressof"-command isnt using the right delegate type and some functions seem to be missin return commands?!? Could someone please have a look at this and maybe change it, so it works in VB.Net?

Thank you :)
Christian

====

Attribute VB_Name = "Module_PaceMak er"
' =============== =============== ============
' PaceMaker plug-in message control routines
' =============== =============== ============
' Copyleft (c) Olli Parviainen 2004
'
' These routines allow Visual Basic programs to control PaceMaker plug-in.
' Please visit http://www.iki.fi/oparviai/pacemaker for more information about
' PaceMaker plug-in.
'
' Usage:
' - First grab handle of active PaceMaker plug-in window by calling
' PaceMaker_SeekH andle()
' - Then use the handle to control the PaceMaker plug-in with routines
' PaceMaker_GetVe rsion(), PaceMaker_SetTe mpo(), PaceMaker_SetPi tch() and so on.
'
' License: All permissions granted. This source code can be used, modified and
' included in applications without restrinctions.
'
' $Id: PaceMaker.bas,v 1.1 2004/08/28 13:16:34 Olli Exp $
'
' =============== =============== =============== =============== =============== ==

' Windows API function declarations
Private Declare Function EnumWindows Lib "USER32.dll " (ByVal lpEnumFunc As Long, _
ByVal lParam As Long) As Long

Private Declare Function GetWindowText Lib "USER32.dll " Alias "GetWindowTextA " (ByVal hwnd As Long, _
ByVal lpString As String, ByVal aint As Long) As Long

Private Declare Function SendMessageTime out Lib "USER32.dll " Alias "SendMessageTim eoutA" _
(ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As _
Long, ByVal fuFlags As Long, ByVal uTimeout As Long, lpdwResult As Long) As Long

Private Declare Function PostMessage Lib "USER32.dll " Alias "PostMessag eA" _
(ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Private hPaceMaker As Long

' Constants
Private Const SMTO_ABORTIFHUN G = 2
Private Const WM_APP = 32768
Private Const SCALE_COEFF = 1000
Public Const PM_IDENTIFY = WM_APP + 0
Public Const PM_GETVERSION = WM_APP + 1
Public Const PM_ENABLE_SHADO WMODE = WM_APP + 2
Public Const PM_ENABLE_TWEAK ING = WM_APP + 3
Public Const PM_RESET = WM_APP + 5
Public Const PM_SET_TEMPO = WM_APP + 6
Public Const PM_SET_PITCH = WM_APP + 7
Public Const PM_SET_SPEED = WM_APP + 8
Public Const PM_IS_REGISTERE D = WM_APP + 10

' This function checks if a window being enumerated has a title beginning
' with "PaceMaker"
Private Function EnumWindowsProc (ByVal hwnd As Long, ByVal lParam As Long) As Long

Dim sWindowTitle As String
Dim r As Integer
Dim response As Long

sWindowTitle = Space(255)
' Compare beginning of window title
r = GetWindowText(h wnd, sWindowTitle, 255)

EnumWindowsProc = True

If Left(sWindowTit le, 9) = "PaceMaker" Then
' Found a window having title beginning with "PaceMaker. ..".
' Test now that it's the real thing.
If PaceMaker_SendC ommand(hwnd, PM_IDENTIFY, 0, response) <> 0 Then
' We got a response of some kind
If response = &H1770 Then
' Ho! found PaceMaker
hPaceMaker = hwnd
EnumWindowsProc = False
End If

End If
End If

End Function

'Function that returns handle to PaceMaker window if found
Public Function PaceMaker_SeekH andle() As Long
hPaceMaker = 0
' Call function 'EnumWindows' to seek for a window with title
' beginning with 'PaceMaker'
r = EnumWindows(Add ressOf EnumWindowsProc , hPaceMaker)

PaceMaker_SeekH andle = hPaceMaker
End Function
' Subroutine for sending a command query message to PaceMaker
Public Function PaceMaker_SendC ommand(hPaceMak er As Long, command As Long, _
param As Long, response As Long) As Long

PaceMaker_SendC ommand = SendMessageTime out(hPaceMaker, command, param, 0, SMTO_ABORTIFHUN G, 1000, response)

End Function
' Get PaceMaker version identifier.
Public Function PaceMaker_GetVe rsion(hPaceMake r As Long) As Long
r = PaceMaker_SendC ommand(hPaceMak er, PM_GETVERSION, 0, PaceMaker_GetVe rsion)
End Function
' Query if PaceMaker plug-in has been registered (requirement for commercial use etc).
Public Function PaceMaker_IsReg istered(hPaceMa ker As Long) As Long
r = PaceMaker_SendC ommand(hPaceMak er, PM_IS_REGISTERE D, 0, PaceMaker_IsReg istered)
End Function
' Enable/disable PaceMaker window shadow mode
Public Sub PaceMaker_Enabl eShadowMode(hPa ceMaker As Long, bEnable As Boolean)
r = PostMessage(hPa ceMaker, PM_ENABLE_SHADO WMODE, 0, bEnable)
End Sub
' Enable/disable PaceMaker sound tweaking
Public Sub PaceMaker_Enabl eTweaking(hPace Maker As Long, bEnable As Boolean)
r = PostMessage(hPa ceMaker, PM_ENABLE_TWEAK ING, 0, bEnable)
End Sub
' Reset PaceMaker tempo/pitch/speed controls
Public Sub PaceMaker_Reset (hPaceMaker As Long)
r = PostMessage(hPa ceMaker, PM_RESET, 0, 0)
End Sub
' Set new tempo setting
Public Sub PaceMaker_SetTe mpo(hPaceMaker As Long, ByVal Tempo As Double)
Dim value As Long
value = Tempo * SCALE_COEFF
r = PostMessage(hPa ceMaker, PM_SET_TEMPO, 0, value)
End Sub
' Set new pitch setting
Public Sub PaceMaker_SetPi tch(hPaceMaker As Long, ByVal Pitch As Double)
Dim value As Long
value = Pitch * SCALE_COEFF
r = PostMessage(hPa ceMaker, PM_SET_PITCH, 0, value)
End Sub
' Set new speed setting
Public Sub PaceMaker_SetSp eed(hPaceMaker As Long, ByVal Speed As Double)
Dim value As Long
value = Speed * SCALE_COEFF
r = PostMessage(hPa ceMaker, PM_SET_SPEED, 0, value)
End Sub
Mar 27 '11 #1
0 1400

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3905
by: Michael Hogan | last post by:
I want to pars a playlist file for three different varibles, so I can save them as mp3 files. I am using: strTEMPURL = GetUrlSource(Text1.Text) to put the entire .pls file into a strTEMPURL varible. I want to grab .pls files from shoutcast and break them into varibles. ----------------Begin winamp.pls file-------------------
1
2262
by: BadOmen | last post by:
I am using this to send am command to WinAmp and it works, The Open File(s) is opening but my program halts until I presses the Open or Cancel button. I think my program is waiting for a returned value that is sent from WinAmp when the Cancel or Open button is pressed. I have a problem with this because I am using a remote to execute this command so after I have done that I want to be able to use my remote to move and press the mouse...
1
4862
by: BadOmen | last post by:
This works fine, but I want to be able to make WinAmp3 to play a playlist at startup, how do i do that? This is my playlist... MyPlaylist.b4s //Initsierar activeX Objekt var oShell = new ActiveXObject("Shell.Application"); var commandtoRun = "dir\\Winamp3\\Studio.exe"; oShell.ShellExecute(commandtoRun, "","", "open", "1"); Yours, Jonas
5
2220
by: Kamyk | last post by:
Hello all again! On the main form I have a few fields and among of them there is button which opens additional window (named "Links") where user can delete and add data from the database. I want this user let open (from the main form) only one subform "Links". I hope you know what I mean. An example of my idea is Winamp program, which in the default version opens only once and when somebody wants to open two Winamp programs in the same...
3
2170
by: Ron Vecchi | last post by:
I'm trying to get a list of all file icons registered to file extensions located on the machine. I would like to beable to loop through all icons and save the images in a seperate directory named after the extension they are mapped to. Should be no problem but I can't seem to find any information on finding a way to get a list of icons and extensions registered on the system. Thanks,
1
2260
by: Lasse Edsvik | last post by:
Hello I was wondering if you guys could help me. My goal is to make a program that just show's what my winamp on same comp with a button-click or something. Now I was wondering if you guys could tell me the "steps" i need to do to accieve it? If anyone has managed to do it please share your knowledge :)
2
6330
by: pangel83 | last post by:
I've been trying for days to write a piece of VB.NET code that will read from winamp's memory space the paths of the files from the current winamp playlist. The GETPLAYLISTFILE command of the winamp API will only return a pointer to the position of the asked path. An article available on http://msmvps.com/ch21st/archive/2004/02/26.aspx provides a VB6 implementation of this, using the ReadProcessMemory Windows API command, but something...
8
2258
by: PiotrKolodziej | last post by:
Hi A have a class containing elements of string type. I need to print them using 'for' loop. How to do this. I spent few hours trying to do this from the other approach. Thanks for any help. Here's the class: public static class names {
4
2208
by: Terry Olsen | last post by:
Here's another odd request. I want to embed the winamp window in my app. I have a panel that I want Winamp to be locked to. Using a couple of API calls, I can set the panel as the parent of the main Winamp window like so: WinampHndl = FindWindowEx(Nothing, Nothing, "BaseWindow_RootWnd", "Player Window") x = SetParent(WinampHndl, Panel1.Handle) I try using the MoveWindow call like this:
10
3406
gsgurdeep
by: gsgurdeep | last post by:
winamp in my pc hang my whole system for atleast for 5 minuts, when changing to next track. i'm using xp sp2 core 2 duo laptop. i'm playing only mp3 tracks. please tell me the solution...........
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10329
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.