Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development


Reply
 
Share Thread Tools Display Modes
Old 05-24-2002, 07:28 AM   #1
Maximum Bitrate
 
MikeHunt79's Avatar
 
Join Date: Aug 2001
Location: Cambridge & Bristol, UK
Posts: 707
MikeHunt79
C++ or JAVA for controlling winamp? (long)

I am working on a flash based winamp frontend, which is similar to gutter's & magnetik's winamp/flash/vb program ( http://www.mp3car.com/vbulletin/show...&threadid=8366 ). The problem is that i don`t have VB, so i have no way of interfacing flash with winamp.

Here's the dilemma... I need a way to interface flash with winamp, but the only HLL i know is Java. I also have a copy of Visual C++ lying around, but i have absolutely no C++ experience, and i'm sure i could learn it overnight (or could i ).

I`d like to use C++ because i could bulid the whole thing into one exe, and run it as the shell. It might even run faster as well (i`ll be running a celery 450 in the car). The winamp site has loads of info on using C++ as well as a SDK. I`m just not sure how long it would take though, considering i`ll have to learn C++ as well. Any C++ programmers here have any advice?

I`d like to use JAVA because i already know it, and i'd have time to implement more features. The winamp site has nothing on using java, but i did manage to find a java plug in though- execpt the authors website
website has gone down. I found a archived copy though, but only half the documentation was intact. I`ve tried e-mailing plug in author for the documentation, but i think his e-mail address went down with his website.
Another disadvantage is that i couldn`t run the program as an .exe from the shell, but i`m sure i could find someway of running it on boot up.

Please help.... Has anyone here already tried using C++ or Java? Any input and information is appeciated, as i havent a clue what to do.
__________________
My Setup
MikeHunt79 is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 05-24-2002, 10:54 AM   #2
FLAC
 
Join Date: Apr 2001
Location: Here, There, Everywhere
Posts: 1,436
magnetik
Mike,

first idea, get VB6 and learn it!! If you have a good C++ knowledge then you will have no trubbles picking it up... and makes for some great rapid development.

maybe speak to Charles a bit more, since his Cobra applications are coded in C/C++ and he is a total fan of the lang!!

dunno about JAVA, but I would guess that it would be hard to use the winamp API thru the JDK..... I could be wrong, but I think a native win32 lang would make the job alot easier for you... and quicker too. JAVA can be a dog in runtime...
__________________
Project - GAME OVER :(
magnetik is offline   Reply With Quote
Old 05-24-2002, 11:38 AM   #3
Low Bitrate
 
Join Date: May 2002
Location: Wisconsin
Posts: 76
Cyanide
VB. *grin*
Cyanide is offline   Reply With Quote
Old 05-24-2002, 12:06 PM   #4
FLAC
 
Gutter's Avatar
 
Join Date: Dec 1999
Location: Casina, Italy
Posts: 900
Gutter is on a distinguished road
Re: C++ or JAVA for controlling winamp? (long)

Quote:
Originally posted by MikeHunt79
The problem is that i don`t have VB, so i have no way of interfacing flash with winamp.


This is a misconception which I've heard a few times. Flash shouldn't control anything. It only reflects what your program has done and in my case, does double duty by catching keystrokes. Winamp's developer's page has examples for controlling winamp with VB and C++. I'm sure you can find Java examples too.

So if you're changing a song, your program will send a message to Winamp to load a certain song, then you send whatever info (Song title, artist, etc) to Flash.


Quote:
Originally posted by MikeHunt79
Here's the dilemma... I need a way to interface flash with winamp, but the only HLL i know is Java. I also have a copy of Visual C++ lying around, but i have absolutely no C++ experience, and i'm sure i could learn it overnight (or could i ).

Since you know Java, you could probably pump something out in a few days. I suggest going with your strongest suit, Java, even though it's slower than all hell.

What will be nice is that it will probably run in *nix fairly easily.

Quote:
Originally posted by MikeHunt79
I`d like to use C++ because i could bulid the whole thing into one exe, and run it as the shell.

VB creates a single exe file that you execute. Using Inno Setup, you can easily create a single setup file.

Quote:
Originally posted by MikeHunt79
The winamp site has nothing on using java

Did you download the gen_hotkey plugin I posted a few weeks ago? You just send keystrokes out into space and the plug-in will catch it. That will work with Java rather easily.


Quote:
Originally posted by MikeHunt79
Another disadvantage is that i couldn`t run the program as an .exe from the shell, but i`m sure i could find someway of running it on boot up.

Why don't you work on a quasi-embedded system? Download QNX or Slackware and build around that. God knows there are enough Windows systems out there.

Good luck.
__________________
Don't Click
Gutter is offline   Reply With Quote
Old 05-24-2002, 03:19 PM   #5
Maximum Bitrate
 
MikeHunt79's Avatar
 
Join Date: Aug 2001
Location: Cambridge & Bristol, UK
Posts: 707
MikeHunt79
Re: Re: C++ or JAVA for controlling winamp? (long)

Quote:
Originally posted by magnetik
first idea, get VB6 and learn it!! If you have a good C++ knowledge then you will have no trubbles picking it up... and makes for some great rapid development.

I don`t have any C++ knowledge at the moment I'll keep an eye open for a copy of VB tho (student = no money), i`m starting to think it is the easiest option, especially after looking at the source code for (gutters?) impee3 amp software...
Quote:
Originally posted by magnetik
maybe speak to Charles a bit more, since his Cobra applications are coded in C/C++ and he is a total fan of the lang!!
dunno about JAVA, but I would guess that it would be hard to use the winamp API thru the JDK..... I could be wrong, but I think a native win32 lang would make the job alot easier for you... and quicker too. JAVA can be a dog in runtime...

This Java plug-in i got might help with that, it`s like a wrapper for winamp, but i haven`t had much time to play with it.
Quote:
Originally posted by Gutter
This is a misconception which I've heard a few times. Flash shouldn't control anything. It only reflects what your program has done and in my case, does double duty by catching keystrokes. Winamp's developer's page has examples for controlling winamp with VB and C++. I'm sure you can find Java examples too.
So if you're changing a song, your program will send a message to Winamp to load a certain song, then you send whatever info (Song title, artist, etc) to Flash.

Unfortunately, the winamp site seems to have every example except Java, which is a pain. I`m sure with some info from some java sites, i could figure out how to send and recieve windows messages from Java.
Quote:
Originally posted by Gutter
Since you know Java, you could probably pump something out in a few days. I suggest going with your strongest suit, Java, even though it's slower than all hell.
What will be nice is that it will probably run in *nix fairly easily.

I suppose unix compatibility is a plus (it would probably run quicker aswell - i think linux has a better vm), but i`ve never touched linux/unix at all.... but if i ever get some free time (and thats a big if), i could give it a go. Lower boot time is probably the biggest linux plus for me.
Quote:
Originally posted by Gutter
Did you download the gen_hotkey plugin I posted a few weeks ago? You just send keystrokes out into space and the plug-in will catch it. That will work with Java rather easily.
Good luck.

Cheers. I`ll pick up that hotkey plug in, it sounds good, but i`m still gonna have to program routines for songtitles, etc. aren't i?
Anyway, I`ll see how i get on with this JAVA plug-in tonight... and if it works, then i`ll write a test program.... If it`s too slow, then i'll port it to C++ next semester, as i`m taking a module which teaches C++. And if it all goes wrong, can always ask around and see if i can borrow of vb off someone
Thanx for your help, it`s appreciated.
PS: i`m in my very early stages, but i`ve done the main menu. It doesn`t do anything at the moment, execpt looking pretty : http://netlab.csd.anglia.ac.uk/~csd01wwm/mp3car/
__________________
My Setup
MikeHunt79 is offline   Reply With Quote
Old 05-24-2002, 04:23 PM   #6
FLAC
 
Gutter's Avatar
 
Join Date: Dec 1999
Location: Casina, Italy
Posts: 900
Gutter is on a distinguished road
VB6 = $42.96

http://www.provantage.com/scripts/go.dll/-s/fp_18695

Maybe even cheaper with a student discount at some places.

Using parts of my sourcecode and the flash frontend you made, it should be pretty easy. You'll probably grasp VB a lot faster than C++.
__________________
Don't Click
Gutter is offline   Reply With Quote
Old 05-25-2002, 12:37 AM   #7
FLAC
 
PatO's Avatar
 
Join Date: Dec 2000
Location: Afton MN
Posts: 1,120
PatO is on a distinguished road
Get VB.
Or, get a copy of microsoft's version of java. Check out msdn.microsoft.com for examples of interfacing it with windows apps. It's not based on the latest version of java, but will get the job done. And thanks to the *insert explicitive here* lawsuits, I doubt ms will keep updating it.

I don't want to get off on a rant here, but think about it. The lawsuits kill java on windows machines - so the programmers turn to vb and c++. MS still has 90+ percent of the market. Java (a much more advanced language) grows in popularity, but only with enterprise websites. Who wins here?
__________________
http://www.jeepmp3.com/
CarPC Stolen. Starting over.
Ne1 recognize the avatar?
PatO is offline   Reply With Quote
Old 05-26-2002, 11:28 AM   #8
Maximum Bitrate
 
MikeHunt79's Avatar
 
Join Date: Aug 2001
Location: Cambridge & Bristol, UK
Posts: 707
MikeHunt79
Quote:
Originally posted by PatO
Get VB.
Or, get a copy of microsoft's version of java. Check out msdn.microsoft.com for examples of interfacing it with windows apps. It's not based on the latest version of java, but will get the job done. And thanks to the *insert explicitive here* lawsuits, I doubt ms will keep updating it.

I don't want to get off on a rant here, but think about it. The lawsuits kill java on windows machines - so the programmers turn to vb and c++. MS still has 90+ percent of the market. Java (a much more advanced language) grows in popularity, but only with enterprise websites. Who wins here?

I know, it`s really annoying that M$ hates java so much, just cause they never invented it. I'm not sure, but i don't think they invented basic or C, and yet they seem to like those HLL's a lot more... Anyway, I`ve decided that I`m gonna get VB... I`m sure it shouldn`t be too difficult too figure out, especially compared to C++. I`m still doing the flash bit at the moment, anyway.

Thanx again for everyones help.
__________________
My Setup
MikeHunt79 is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 05-27-2002, 11:21 AM   #9
Maximum Bitrate
 
MikeHunt79's Avatar
 
Join Date: Aug 2001
Location: Cambridge & Bristol, UK
Posts: 707
MikeHunt79
VB 4 free!

It`s here if anyone wants it.... It`s not version 6, i think it`s repackaged version 5, but i`m not complaining since it`s free (free... good)! I`ll see how I get on with it tonight.

Just passing the word on, case anyone needs it.
__________________
My Setup

Last edited by MikeHunt79; 05-27-2002 at 11:23 AM.
MikeHunt79 is offline   Reply With Quote
Old 05-27-2002, 10:44 PM   #10
Newbie
 
Join Date: Oct 2001
Location: Houston, TX
Posts: 33
bent
Quote:
Originally posted by PatO
Get VB.
Or, get a copy of microsoft's version of java. Check out msdn.microsoft.com for examples of interfacing it with windows apps. It's not based on the latest version of java, but will get the job done. And thanks to the *insert explicitive here* lawsuits, I doubt ms will keep updating it.

I don't want to get off on a rant here, but think about it. The lawsuits kill java on windows machines - so the programmers turn to vb and c++. MS still has 90+ percent of the market. Java (a much more advanced language) grows in popularity, but only with enterprise websites. Who wins here?

Actually Microsoft bears almost all the responsibilty for the Win32 snafus with Java. They broke the Java standard by "embracing and extending" java to include things that it was never meant to have. The result? Java apps didn't work properly because Microsoft didn't stick to the standard. That lawsuit that stopped M$ from wrecking the Java standard, and today the Sun Win32 VM (that you can get at java.sun.com) works just fine. The Microsoft Win32 VM, does not.

And you may want to consider using the Java Media Framework to play MP3's in Java. It only takes 4 lines of code:

DataSource ds = Manager.createDataSource(new URL("file://SomeArtist - SomeSong.mp3"));
Player p = Manager.createPlayer(ds);
p.realize();
p.start();

And using the Player object you have total control over the song's playback.
bent is offline   Reply With Quote
Old 05-27-2002, 10:50 PM   #11
Newbie
 
Join Date: Oct 2001
Location: Houston, TX
Posts: 33
bent
Quote:
Originally posted by Gutter
VB6 = $42.96

http://www.provantage.com/scripts/go.dll/-s/fp_18695

Maybe even cheaper with a student discount at some places.

Using parts of my sourcecode and the flash frontend you made, it should be pretty easy. You'll probably grasp VB a lot faster than C++.

You might also want to try Eclipse, which is IBM's open source Integrated Development Environment. It supports Java, C++, and lots of other languages. Oh, and it's FREE.

Check it out:

http://www.eclipse.org/
bent is offline   Reply With Quote
Old 06-01-2002, 08:39 AM   #12
Registered User
 
MP3IAN by Ian Gregory's Avatar
 
Join Date: Jan 2002
Location: Wollongong, Australia
Posts: 158
MP3IAN by Ian Gregory
Quote:
i have absolutely no C++ experience, and i'm sure i could learn it overnight



Heheheh,
I would say that i am pretty proficient in C++ however i have been learning it for a year and a half now....
good luck overnight. The Java experience will help a treat though!
MP3IAN by Ian Gregory is offline   Reply With Quote
Old 06-01-2002, 10:14 AM   #13
Maximum Bitrate
 
MikeHunt79's Avatar
 
Join Date: Aug 2001
Location: Cambridge & Bristol, UK
Posts: 707
MikeHunt79
lol... that was a typo.... i mean`t couldn`t instead of could..... anyway, thanx 4 the input, i`ll post when i get the software functional...
__________________
My Setup
MikeHunt79 is offline   Reply With Quote
Old 06-05-2002, 12:36 PM   #14
Maximum Bitrate
 
starfox's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 451
starfox
Whichever language you use, you'll probably want to talk to Winamp using the message system that Nullsoft created for Winamp 2.XX. It's pretty nasty and badly planned, but it works alright.

You'll need to use SendMessage() for this, so this leaves you with Visual C++, C Builder, Delphi or VB. Take a look here for Nullsoft's notes on how to talk to Winamp using SendMessage:
http://www.winamp.com/nsdn/winamp2x/dev/sdk/api.jhtml

I'm writing a frontend in VB for my carmp3 project.. It's a bit more complicated than most. It's designed for a 40x2 HD44780 LCD through the parallel port, and has code to talk to it. It also has a simple playlist scroller, playlist builder, and also talks to MBM to read the CPU temp. If there's enough interest i can upload the source somewhere if anyone wants to read through it... It's fairly complicated though.
starfox is offline   Reply With Quote
Old 06-05-2002, 07:51 PM   #15
FLAC
 
Join Date: Apr 2001
Location: Here, There, Everywhere
Posts: 1,436
magnetik
Quote:
Originally posted by starfox
[B]Whichever language you use, you'll probably want to talk to Winamp using the message system that Nullsoft created for Winamp 2.XX. It's pretty nasty and badly planned, but it works alright.

its not that bad!! its the windows API, all apps that include one use 'sendmessage' anyway..... learn to love it!!

once u get your code libary of VB code to run winamp programmed correctly it works a treat...
__________________
Project - GAME OVER :(
magnetik is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

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 Off




All times are GMT -5. The time now is 12:10 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics