ASECO 2.x | daemon Music Plugin v0.7

This forum is dedicated to the Aseco/Rasp 2 server records and control script by Flo and Assembler Maniac. Announcements and issues can be discussed in this forum.

Moderators: Flo, f*ckfish, Assembler Maniac, TM-Patrol

User avatar
daemon
sunday driver
sunday driver
Posts: 68
Joined: 09 Mar 2006 17:28
Location: México
Contact:

ASECO 2.x | daemon Music Plugin v0.7

Post by daemon » 17 Jun 2008 06:13

Hello, this is a music management plugin, Still has some bugs but I've been short of time lately to squash them, so here it is for now if someone needs something like this. Hope it works as intended, since I've only tested it with one player online (myself lol). Thanks to AssemblerManiac and f*ckfish for ASECO/fufi plugins, for helping me with some things and for some code I borrowed :P , and to oliverde8 for an awesome menu. :thumbsup:

DOWNLOAD LINK:
http://www.fileden.com/files/2008/4/22/ ... n_v0.7.rar

FEATURES:
- Loads songs info from a xml file (url, artist and title).
- Music box where you can see and choose available songs.
- Configurable onscreen music widget displaying song info.

COMMANDS:

Code: Select all

/mb *wildcard*				Shows the available songs, can be used with a wildcard (/mb songname, /mb artist, etc)
/admin music on				Turns custom music on
/admin music off			Turns custom music off
/admin music random			Plays music in default order
/admin music default			Plays music in random order
/admin music mballon			Anyone can jukebox songs
/admin music mballoff			Only admins can jukebox songs
/admin music clearmb			Clears Music box queue
/admin music skipmb			Skips next Music box song
/admin music loadplaylist		Reloads musiclist.xml
/admin music widgeton			Shows the music widget
/admin music widgetoff			Hides the music widget
XML File Sample (included in the rar):

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<songs>
<song>
<url>http://www.site.com/file01.mux</url>
<artist>Pepe el toro</artist>
<title>Ay Jalisco</title>
</song>
<song>
<url>http://www.site.com/file02.ogg</url>
<artist>Chancho</artist>
<title>Juana la cubana</title>
</song>
</songs>
IMAGES

Image showing the music widget (left side), it can be turned on/off, and it can be moved (up/down, left/right) relatively easy, and also minimized by clicking on it.
Image

Image showing the music box, where you can see available songs and choose them.
Image


OLIVERDE8'S MENU

Also for those who use oliver's menu, you can copy paste this to show an admin custom music menu like in the pics above:

oliverde8.Hud.menu.xml

Code: Select all

			<button caption="Custom Music">
			  <button caption="Turn Off" plugin="oliverde8_Hud_menu" function="Musicmanager" />
			  <button caption="Turn On" plugin="oliverde8_Hud_menu" function="Musicmanager" /> 
			  <button caption="Random order" plugin="oliverde8_Hud_menu" function="Musicmanager" />
			  <button caption="Default order" plugin="oliverde8_Hud_menu" function="Musicmanager" />
			  <button caption="MB all" plugin="oliverde8_Hud_menu" function="Musicmanager" />
			  <button caption="MB admins" plugin="oliverde8_Hud_menu" function="Musicmanager" />
			  <button caption="Widget On" plugin="oliverde8_Hud_menu" function="Musicmanager" />
			  <button caption="Widget Off" plugin="oliverde8_Hud_menu" function="Musicmanager" />			  
			  <button caption="Clear music box" plugin="oliverde8_Hud_menu" function="Musicmanager" />
			  <button caption="Skip music box" plugin="oliverde8_Hud_menu" function="Musicmanager" />
			  <button caption="Load playlist" plugin="oliverde8_Hud_menu" function="Musicmanager" />		  		  
			  <button caption="Music Box" plugin="oliverde8_Hud_menu" function="MusicBox"/>			  		  		  		  		  
			</button>	
oliverde8.Hud.menu.php (Paste it in extra functions, almost at the end)

Code: Select all

	function Musicbox(&$command){
		$musicbox=$this->Aseco->getPlugin('CustomMusic');	
		$musicbox->musicBoxPreload($command);
	}
	
	function Musicmanager(&$command){
		$music=$this->Aseco->getPlugin('CustomMusic');	
		$button = $this->_buttons[$command['Nbutton']];
		switch($button['title']) {
			case 'Turn On'			: 	$command['params']="on";
										break;
			case 'Turn Off'			:	$command['params']="off";
										break;
			case 'Random order'		:	$command['params']="random";
										break;			
			case 'Default order'	:	$command['params']="default";
										break;						
			case 'MB all'			:	$command['params']="mballon";
										break;									
			case 'MB admins'		:	$command['params']="mballoff";
										break;		
			case 'Widget On'		:	$command['params']="widgeton";
										break;									
			case 'Widget Off'		:	$command['params']="widgetoff";
										break;												
			case 'Clear music box'	:	$command['params']="clearmb";
										break;																																										
			case 'Skip music box'	:	$command['params']="skipmb";
										break;		
			case 'Load playlist'	:	$command['params']="loadplaylist";
										break;												
		}
		$music->musicManager($command);
	}	
I guess thats it for now, If you have any feedback its more than welcome, thanks hehe.
Image
It's the decisions you make, when you have no time to make them, that define who you are.

GuyCoast
wheelbarrow operator
wheelbarrow operator
Posts: 18
Joined: 21 Nov 2006 08:47
Owned TM-games: TMF
Location: ITALY
Contact:

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by GuyCoast » 17 Jun 2008 10:05

WOW! Nice plugin, now run on my server :thumbsup:

User avatar
s!em
speedy pilot
speedy pilot
Posts: 573
Joined: 06 Dec 2005 12:53
Owned TM-games: ALL
Location: Belgium

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by s!em » 17 Jun 2008 10:10

Looks great :O
I'll install it later, but this looks really great :D

User avatar
s!em
speedy pilot
speedy pilot
Posts: 573
Joined: 06 Dec 2005 12:53
Owned TM-games: ALL
Location: Belgium

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by s!em » 17 Jun 2008 13:53

I can't get it working...

Meiffe
highway camper
highway camper
Posts: 1
Joined: 10 Jun 2008 08:17
Owned TM-games: TMN
Location: http://duvenage.de
Contact:

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by Meiffe » 17 Jun 2008 14:07

GREAT !!! :thumbsup: :D
Image

User avatar
s!em
speedy pilot
speedy pilot
Posts: 573
Joined: 06 Dec 2005 12:53
Owned TM-games: ALL
Location: Belgium

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by s!em » 20 Jun 2008 06:19

It works, great plugin!
only the oliverde8 menu doesn't works, could you give a modified menu plugin?
and if I press /admin music on he says I've to be admin to do that
but after all, a great great plugin. I could suggest you to use ID3Tags and not an xml file
maybe an xml file only for the link where to download it. well I don't think it's easy to use ID3Tags

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by nocturne » 20 Jun 2008 20:48

Well, from what I recall, the tags can't be pulled out too easily. Previously in TMN, I know xymph's data fetcher could only retrieve the filename, but in those days it was only dealing with muxed tracks, not directly with music files like currently.

SmokeAlot
wheelbarrow operator
wheelbarrow operator
Posts: 20
Joined: 03 Dec 2007 13:19
Owned TM-games: TMU, TMN

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by SmokeAlot » 23 Jun 2008 12:01

s!em wrote:I could suggest you to use ID3Tags and not an xml file
maybe an xml file only for the link where to download it. well I don't think it's easy to use ID3Tags
You should change the id3 tags in your mediaplayer

I prefer to use winamp for as it has worked a treat

Change the id3 tags before you convert to .ogg and respectively the .mux

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by nocturne » 23 Jun 2008 18:45

SmokeAlot wrote:You should change the id3 tags in your mediaplayer

I prefer to use winamp for as it has worked a treat

Change the id3 tags before you convert to .ogg and respectively the .mux
It's not an issue of embedding the tags into the file, but rather using the script to 'decode' those tags so the artist/song info can be displayed by the script.

There's this php class for decoding tags from OGG, and I'm sure there's a way to pull them from a mux also...

User avatar
oliverde8
solid chaser
solid chaser
Posts: 1135
Joined: 07 Oct 2006 07:03
Owned TM-games: TMU
Manialink(s): oliverde8
Location: Turkey
Contact:

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by oliverde8 » 24 Jun 2008 08:25

2 nminute internet ...
Seems nice :thumbsup:

Using my Menu shouln't need any modifications in it you don't even need to chenge it XML file

Code: Select all

$menu=$this->Aseco->getPlugin('oliverde8_Hud_menu);
if($menu){
//Adding Sub Menu TO admin Menu
$new["caption"]="Custom Music";
$new["deccalage"]=0;
$new["cat"]="admin";
$menu->addButton($new);

//Adding Buttons
$new["caption"]="Music On";
$new["Chat"]="/admin music on";
$new["deccalage"]=1;
$new["cat"]="Custom Music";
$menu->addButton($new);
}
This should work(should I can't test on my friend) just need to put it on start of the PLugin and it goes

Or in the XML

Code: Select all

<button caption="Custom Music">
           <button caption="Turn On" chat="/admin music on" />
</button>
ImageImage
Manialink : oliverde8color>
Servers : STATS <> United | VeryShort | Made In Turkey

Xymph
Pit Crew
Pit Crew
Posts: 5653
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by Xymph » 24 Jun 2008 10:03

nocturne wrote:Well, from what I recall, the tags can't be pulled out too easily. Previously in TMN, I know xymph's data fetcher could only retrieve the filename, but in those days it was only dealing with muxed tracks, not directly with music files like currently.
To recap, my GBX Data Fetcher class uses a track's XML block as a starting point to find the path to an optionally embedded song (either .ogg or .mux), and in XAseco its filename would be returned with the /song command.

There were two reasons why that command didn't decode the song's ID3 artist/title tags and show those instead of the raw filename:
nocturne wrote:It's not an issue of embedding the tags into the file, but rather using the script to 'decode' those tags so the artist/song info can be displayed by the script.
There's this php class for decoding tags from OGG, and I'm sure there's a way to pull them from a mux also...
The first reason was that I didn't have (nor search very hard for) code to process OGG files and extract the tags, so this link is most useful. Thanks.

The second, more fundamental reason however makes it quite futile to attempt this decoding for a track's embedded song: a controller (like XAseco) runs on the server, but the actual song file is transferred via P2P directly to the players and doesn't necessarily exist on the server (especially not if that server disabled P2P to save bandwidth), and thus couldn't be read and decoded. Even if the song file would make it onto the server, it's stored in the GameData/Cache/ directory with a hash prefix, so it would take a little searching to find it. All that was far beyond the scope of the GBX Data Fetcher class.

Anyway, within the scope of a music management plugin reading ID3 tags from OGG files may be useful (but it doesn't work with the encrypted MUX files, obviously).
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

User avatar
s!em
speedy pilot
speedy pilot
Posts: 573
Joined: 06 Dec 2005 12:53
Owned TM-games: ALL
Location: Belgium

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by s!em » 24 Jun 2008 11:05

I've to be admin to do anything with the music plugin, but I'm admin of the server, does I have to add something in admingroups.xml?

Ptitzizi
road tourist
road tourist
Posts: 104
Joined: 03 May 2008 15:13
Owned TM-games: TMF

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by Ptitzizi » 24 Jun 2008 12:22

Hey,
great plugin but I have few request :)
Is it possible to load a song just after it's over ? 'cause for example, in my Match Training Server, the duration of a round is 10 minutes, so the song plays 3 or 4 times :D
Is it possible to add in game a url song ? I can imagine it'snt possible because I have to add a title and a author but who knows ? :P

I have few questions :
I don't understand how list all the songs like the /list of the jukebox tracks.
Can I next during a song ?
Can we have your style for the great oliverde8 HUD ?

And just for knowing, when the download of the songs begin ?
There is a kind of cache ?

Thanx a lot !
Bye :)

Xymph
Pit Crew
Pit Crew
Posts: 5653
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by Xymph » 24 Jun 2008 12:51

Ptitzizi wrote:Is it possible to load a song just after it's over ? 'cause for example, in my Match Training Server, the duration of a round is 10 minutes, so the song plays 3 or 4 times :D
No, as mentioned in the original music plugin thread, a new song is loaded only at the start of a new challenge (track), until then the current song keeps looping.
Ptitzizi wrote:And just for knowing, when the download of the songs begin ?
There is a kind of cache ?
It's downloaded once, then cached on the client. Again, read the whole music plugin thread for a better understanding.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

fordry
speedy pilot
speedy pilot
Posts: 368
Joined: 24 Jan 2008 20:53
Owned TM-games: TMUF TMN
Contact:

Re: ASECO 2.x | daemon Music Plugin v0.7

Post by fordry » 06 Jul 2008 07:52

Is there any way that when the replaymap or restartmap commands are used, that the plugin would continue to display the correct song info? Have noticed that it says that its the next song but it plays the same one. Or even better, especially since the replaymap command reloads the track, would it be possible with that command to have the music change to the next song?

Post Reply