Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
About Us Register FAQ Members List Calendar Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old September 29th, 2003   #1 (permalink)
Registered User
 
Archlyn's Avatar
 
Join Date: Aug 2001
Location: The land of Insanity
Posts: 571
HTML prolem with streaming midi file

Okay, I have a set of midis I want the user of this page to be able to pick thriough, kinda like a jukebox. I have a dropdown box with the song names and the values are the paths to the files, relative to the page's location on my server... like this:

Code:
[option value="path/to/file1.mid"]Song name 1[/option]
[option value="path/to/file2.mid"]Song name 2[/option]
[option value="path/to/file3.mid"]Song name 3[/option]
...
[option value="path/to/file10.mid"]Song name 10[/option]
and I'm trying to use that form to set the [EMBED] tag's 'src' attribute to the currently selected item's (in the dropdown box) value.

Is there a way to do this?

Should I use something else besides the [embed] tag?

Does this work in all the major browsers?

And yes, I know you have to use the > and < characters for html tags, but they screw my post up
Archlyn is offline   Reply With Quote
Old September 29th, 2003   #2 (permalink)
Registered User
 
scottlc's Avatar
 
Join Date: Sep 2002
Location: St Andrews, Scotland
Posts: 1,575
Re: HTML prolem with streaming midi file

Maybe somebody could clarify this but I'm sure that it would be possible with JavaScript.

Perhaps with:
Code:
embeddedclib.src = formselection.value;
__________________
OS: Arch Linux w/ Kernel 2.6.23.8 + GNOME 2.20.1 - CPU: Intel Pentium M 1.5GHz - Memory: 1280MB DDR PC2700 - Browser: Mozilla Firefox 2.0.0.10
scottlc is offline   Reply With Quote
Old September 30th, 2003   #3 (permalink)
Registered User
 
Archlyn's Avatar
 
Join Date: Aug 2001
Location: The land of Insanity
Posts: 571
Re: HTML prolem with streaming midi file

That gets it to play the defualt selected item on the menu, but it doesn't make it play the file I select.
__________________
Computer Specs: ASUS A8N SLI Deluxe (nForce4) | AMD Athlon X2 3800 @ 2.0ghz | 2x1.0GB OCZ Platinum DDR400 RAM (128-bit DDR mode) | GeForce 7600 w/ 256mb VRAM | Onboard Sound - for now

OS1 : Windows XP / SP2 | Direct X 9
OS2 : Gentoo Linux 2006.0
OS3 : Windows Vista Beta 2

ePSXe config: Pete's OpenGL 2.0 | Eternal SPU 1.4 | ePSXe Internal CD core (W2K)
Project 64 config Jabo's D3D7 1.5 | Jabo's DSound 1.5 | Jabo's DInput 1.5
Archlyn is offline   Reply With Quote
Old September 30th, 2003   #4 (permalink)
Registered User
 
scottlc's Avatar
 
Join Date: Sep 2002
Location: St Andrews, Scotland
Posts: 1,575
Re: HTML prolem with streaming midi file

Yeah, but if you add that to the "onchange" property it should change.
__________________
OS: Arch Linux w/ Kernel 2.6.23.8 + GNOME 2.20.1 - CPU: Intel Pentium M 1.5GHz - Memory: 1280MB DDR PC2700 - Browser: Mozilla Firefox 2.0.0.10
scottlc is offline   Reply With Quote
Old September 30th, 2003   #5 (permalink)
Registered User
 
Archlyn's Avatar
 
Join Date: Aug 2001
Location: The land of Insanity
Posts: 571
Re: HTML prolem with streaming midi file

So something like this?

Code:
[select name="songlist" id="songlist" onChange=embed.src= document.form1.songlist.selectedIndex.value;]
It's just that I tried that formselection.value and it doesn't work at all.
__________________
Computer Specs: ASUS A8N SLI Deluxe (nForce4) | AMD Athlon X2 3800 @ 2.0ghz | 2x1.0GB OCZ Platinum DDR400 RAM (128-bit DDR mode) | GeForce 7600 w/ 256mb VRAM | Onboard Sound - for now

OS1 : Windows XP / SP2 | Direct X 9
OS2 : Gentoo Linux 2006.0
OS3 : Windows Vista Beta 2

ePSXe config: Pete's OpenGL 2.0 | Eternal SPU 1.4 | ePSXe Internal CD core (W2K)
Project 64 config Jabo's D3D7 1.5 | Jabo's DSound 1.5 | Jabo's DInput 1.5
Archlyn is offline   Reply With Quote
Old September 30th, 2003   #6 (permalink)
I Need a Weapon
 
FLaRe85's Avatar
 
Join Date: Oct 2001
Location: Omaha, NE
Posts: 4,318
Re: HTML prolem with streaming midi file

Just to clarify, MIDI doesn't stream. Although I think I see your problem. selectedIndex and value are two different properties of the SELECT element. selectedIndex returns the ordinal position of a selected OPTION element within the SELECT tag. value will return the value of the currently selection OPTION element within the SELECT tag.

Try changing what you have above to this:
Code:
[select name="songlist" onChange="embed.src=this.value;"]
__________________
.: Flaretech.Net :: Flaretech.Biz Web Hosting :: H3 Stats :: My Blog :.



.: Mac Pro :: Dual Quad-Core Intel Xeon 5400s :: 6 GB 800MHz DDR2 ECC FB-DIMMs :: NVIDIA GeForce 8800 GT 512 MB GDDR3 :.
.: Macbook Pro 17" :: 2.33 GHz Intel Core 2 Duo :: 2 GB 667 MHz DDR2 :: ATI Radeon X1600 :.
.: Home Server :: 2.41 GHz AMD Opteron 180 :: 4 GB DDR400 :: Windows Server 2003 Enterprise R2 :.
FLaRe85 is offline   Reply With Quote
Old September 30th, 2003   #7 (permalink)
Registered User
 
Archlyn's Avatar
 
Join Date: Aug 2001
Location: The land of Insanity
Posts: 571
Re: HTML prolem with streaming midi file

Code:
[!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"]

HTML Code:
[head]
[title]Untitled Document[/title]
[meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"]
[/head]
[body]
[embed src="" hidden="true" autostart="true" loop="true" name="embed" id="embed"]
[/embed]
[form name="form1" id="form1"]
[select name="songlist" onChange="embed.src=this.value;"]
[option value="path/to/file1.mid"]song 1[/option]
[option value="path/to/file2.mid"]song 2[/option]
[/select]
[/form]
[/body]
The above is the code to my webpage in it's entirety. The suggestions here aren't working, and I think it's my fault. Can someone patch it up for me and fix any errors and such?
__________________
Computer Specs: ASUS A8N SLI Deluxe (nForce4) | AMD Athlon X2 3800 @ 2.0ghz | 2x1.0GB OCZ Platinum DDR400 RAM (128-bit DDR mode) | GeForce 7600 w/ 256mb VRAM | Onboard Sound - for now

OS1 : Windows XP / SP2 | Direct X 9
OS2 : Gentoo Linux 2006.0
OS3 : Windows Vista Beta 2

ePSXe config: Pete's OpenGL 2.0 | Eternal SPU 1.4 | ePSXe Internal CD core (W2K)
Project 64 config Jabo's D3D7 1.5 | Jabo's DSound 1.5 | Jabo's DInput 1.5
Archlyn is offline   Reply With Quote
Old September 30th, 2003   #8 (permalink)
Registered User
 
scottlc's Avatar
 
Join Date: Sep 2002
Location: St Andrews, Scotland
Posts: 1,575
Re: HTML prolem with streaming midi file

The JavaScript should use the name of your object.

Code:
embed.src=songlist.value;
__________________
OS: Arch Linux w/ Kernel 2.6.23.8 + GNOME 2.20.1 - CPU: Intel Pentium M 1.5GHz - Memory: 1280MB DDR PC2700 - Browser: Mozilla Firefox 2.0.0.10
scottlc is offline   Reply With Quote
Old October 1st, 2003   #9 (permalink)
Registered User
 
Archlyn's Avatar
 
Join Date: Aug 2001
Location: The land of Insanity
Posts: 571
Re: HTML prolem with streaming midi file

Doesn't work. is it supposed to be quoated? (like I have it)
__________________
Computer Specs: ASUS A8N SLI Deluxe (nForce4) | AMD Athlon X2 3800 @ 2.0ghz | 2x1.0GB OCZ Platinum DDR400 RAM (128-bit DDR mode) | GeForce 7600 w/ 256mb VRAM | Onboard Sound - for now

OS1 : Windows XP / SP2 | Direct X 9
OS2 : Gentoo Linux 2006.0
OS3 : Windows Vista Beta 2

ePSXe config: Pete's OpenGL 2.0 | Eternal SPU 1.4 | ePSXe Internal CD core (W2K)
Project 64 config Jabo's D3D7 1.5 | Jabo's DSound 1.5 | Jabo's DInput 1.5
Archlyn is offline   Reply With Quote
Old October 1st, 2003   #10 (permalink)
I Need a Weapon
 
FLaRe85's Avatar
 
Join Date: Oct 2001
Location: Omaha, NE
Posts: 4,318
Re: HTML prolem with streaming midi file

Quote:
Originally Posted by scott_uk5
The JavaScript should use the name of your object.

Code:
embed.src=songlist.value;
It can, but it doesn't have to. The 'this' keyboard refers to the object that invoked the event.
__________________
.: Flaretech.Net :: Flaretech.Biz Web Hosting :: H3 Stats :: My Blog :.



.: Mac Pro :: Dual Quad-Core Intel Xeon 5400s :: 6 GB 800MHz DDR2 ECC FB-DIMMs :: NVIDIA GeForce 8800 GT 512 MB GDDR3 :.
.: Macbook Pro 17" :: 2.33 GHz Intel Core 2 Duo :: 2 GB 667 MHz DDR2 :: ATI Radeon X1600 :.
.: Home Server :: 2.41 GHz AMD Opteron 180 :: 4 GB DDR400 :: Windows Server 2003 Enterprise R2 :.

Last edited by ShADoWFLaRe85; October 1st, 2003 at 06:59.
FLaRe85 is offline   Reply With Quote
Old October 1st, 2003   #11 (permalink)
Registered User
 
Join Date: Jul 2003
Location: Los Angeles
Posts: 53
Re: HTML prolem with streaming midi file

It's safer imho to use "this.options[this.selectedIndex].value".

The problem is I think you need to restart the embed...

What I would do is use innerHTML - basically. You would just say divsection.innerHTML = 'new embed';, which would - in theory - start new music.

-[Unknown]
[Unknown] is offline   Reply With Quote
Old October 1st, 2003   #12 (permalink)
Registered User
 
Archlyn's Avatar
 
Join Date: Aug 2001
Location: The land of Insanity
Posts: 571
Re: HTML prolem with streaming midi file

I've never seen that before... can you please provide a basic example? Basically I just want to figure out where to put it in the HTML document, how to reference it, and where to reference it from.

Edit: I got it! [Unknown], You are a Genius!! I ended up having to do some basic js functions though, made things easier to deal with

Thanks for the help!
__________________
Computer Specs: ASUS A8N SLI Deluxe (nForce4) | AMD Athlon X2 3800 @ 2.0ghz | 2x1.0GB OCZ Platinum DDR400 RAM (128-bit DDR mode) | GeForce 7600 w/ 256mb VRAM | Onboard Sound - for now

OS1 : Windows XP / SP2 | Direct X 9
OS2 : Gentoo Linux 2006.0
OS3 : Windows Vista Beta 2

ePSXe config: Pete's OpenGL 2.0 | Eternal SPU 1.4 | ePSXe Internal CD core (W2K)
Project 64 config Jabo's D3D7 1.5 | Jabo's DSound 1.5 | Jabo's DInput 1.5

Last edited by Archlyn; October 1st, 2003 at 17:15.
Archlyn is offline   Reply With Quote
Old October 1st, 2003   #13 (permalink)
Registered User
 
Join Date: Jul 2003
Location: Los Angeles
Posts: 53
Re: HTML prolem with streaming midi file

&lt;script type="text/javascript" language="Javascript"&gt;&lt;!--
function playSong(songName)
{
document.all.song.innerHTML = "embed crap";
}
// --&gt;&lt;/script&gt;
&lt;select onchange="playSong(this.options[this.selectedIndex].value);"&gt;
&lt;option value="http://www.songs.com/cool_song.mid"&gt;Cool Song&lt;/option&gt;
&lt;/select&gt;
&lt;div id="song"&gt;&lt;/div&gt;

-[Unknown]
[Unknown] is offline   Reply With Quote
Old October 1st, 2003   #14 (permalink)
Registered User
 
Archlyn's Avatar
 
Join Date: Aug 2001
Location: The land of Insanity
Posts: 571
Re: HTML prolem with streaming midi file

ROFL! That's exactly the way I ended up doing it. I just didn't get around to posting it til now. Thanks for the assist
__________________
Computer Specs: ASUS A8N SLI Deluxe (nForce4) | AMD Athlon X2 3800 @ 2.0ghz | 2x1.0GB OCZ Platinum DDR400 RAM (128-bit DDR mode) | GeForce 7600 w/ 256mb VRAM | Onboard Sound - for now

OS1 : Windows XP / SP2 | Direct X 9
OS2 : Gentoo Linux 2006.0
OS3 : Windows Vista Beta 2

ePSXe config: Pete's OpenGL 2.0 | Eternal SPU 1.4 | ePSXe Internal CD core (W2K)
Project 64 config Jabo's D3D7 1.5 | Jabo's DSound 1.5 | Jabo's DInput 1.5
Archlyn is offline   Reply With Quote
Old October 5th, 2003   #15 (permalink)
Registered User
 
Join Date: Jul 2003
Location: Los Angeles
Posts: 53
Re: HTML prolem with streaming midi file

No problem, I'm glad I was able to help at all.

-[Unknown]
[Unknown] is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 18:17.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5