aMSN Forums
February 20, 2018, 02:55:17 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Music plugin problem with WinAmp  (Read 5525 times)
JohnD
Newbie

Offline Offline

Posts: 2


View Profile
« on: April 24, 2011, 09:51:27 pm »

While the %title and %artist tags retrieve their right informations, the %album one is irresponsive.
I've tried changing some lines inside the code, but apparently i'm missing how the data structure works.
I've tried adding lines for album in both music.tcl and musicwin.cpp, but failed to understand how the code actually associates the list items to the tags.
I couldn't find any topic on this specific issue, but I hope it can be solved.

Ah, and no - the ID3tags aren't empty.
Logged
alexandernst
Developers
Super Power User
*
Offline Offline

Posts: 886



View Profile WWW
« Reply #1 on: May 01, 2011, 04:05:58 pm »

After changing something in the .cpp file you must compile it again. Further that, I can't help you because I don't have a pc right now (well, actually I do, but it's inside one of the many boxes that I still haven't unpacked) (new house).

I'll have a look at that issue when I get some free tiem, meanwhile try to fix it and if you get it, post the patch here so I can merge it.

Regards
Logged
JohnD
Newbie

Offline Offline

Posts: 2


View Profile
« Reply #2 on: May 02, 2011, 05:19:58 am »

To be honest, I haven't any knowledge in C++.
I have "brief notions" of Delphi and C# so I am mostly guessing what does what through the code.
With luck, I might have something that compiles C++ in one of my cds.

with MusicWin.cpp, I just added the album related lines to his method, but I have no idea where the "getMetainfo" field parameter actually works and if it will recognize "album" as a valid information.

Code:
static int GetWinampInfo(ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[])
{
HWND hwWinamp;

long position;
long playState;

char artist[1024]={'\0'};
char title[1024]={'\0'};
char file[1024]={'\0'};
      char album[1024]={'\0'};

Tcl_Obj *output = Tcl_NewListObj(0,NULL);
Tcl_SetObjResult(interp,output);

if((hwWinamp=FindWindow("Winamp v1.x",NULL))==NULL){ //WinAmp isn't launched so we say it's stopped
Tcl_ListObjAppendElement(interp,output,Tcl_NewIntObj(0));
return TCL_OK;
}
//Get the playing status
playState=(LONG)SendMessage(hwWinamp,WM_WA_IPC,0,IPC_ISPLAYING);
//Get the postion in the play list
position=SendMessage(hwWinamp,WM_WA_IPC,0,IPC_GETLISTPOS);

//Get informations about the filename
getFileName(hwWinamp,position,file,sizeof(file));
getMetaInfo(hwWinamp,file,"ARTIST",artist,sizeof(artist));
getMetaInfo(hwWinamp,file,"title",title,sizeof(artist));
      getMetaInfo(hwWinamp,file,"album",album,sizeof(artist));
//Put informations on the output :
//Status
//Artist
//Title
//File
Tcl_ListObjAppendElement(interp,output,Tcl_NewIntObj(playState));
Tcl_ListObjAppendElement(interp,output,Tcl_NewStringObj(title,-1));
Tcl_ListObjAppendElement(interp,output,Tcl_NewStringObj(artist,-1));
Tcl_ListObjAppendElement(interp,output,Tcl_NewStringObj(file,-1));
      Tcl_ListObjAppendElement(interp,output,Tcl_NewStringObj(album,-1));

return TCL_OK;
}

In music.tcl I am also making a silly guess about adding lines for album info,
but again I have no idea of which part the tcl file plays in the greater scheme.

Code:
###############################################
# ::music::GetSongWinamp                      #
# ------------------------------------------- #
# Gets the current playing song in WinAmp     #
###############################################
proc GetSongWinamp {} {
variable musicpluginpath
load [file join $musicpluginpath MusicWin.tmp]
set tmplst [::music::TreatSongWinamp]

set status [lindex $tmplst 0]
set song [lindex $tmplst 1]
set art [lindex $tmplst 2]
set path [lindex $tmplst 3]
set alb [lindex $tmplst 4]

if {$status == "0"} {
return 0
}

return [list $song $art $path $alb "" ""]
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!