|
 |
|
10-03-2002, 01:55 PM
|
#1
|
|
Low Bitrate
Join Date: Sep 2002
Location: aychamo land
Posts: 92
|
Tips for Developers
Anyone interested in helping with this thread, kinda as a "database" for people who are developing their front-ends to the car MP3 Players?
Here is some info I have found out in the past 24 hours while working on mine.
For WinAmp:
Launch it by calling its executable. When you launch it, you can pass it a Filename of a .mp3, or a Playlist. When loaded as such, it will erase whatever playlist it has loaded.
When you pass it with /ADD in front of the filename, such as:
winamp.com /ADD "playlist.m3u"
It will ENQUEUE whatever you pass to it.
When passing any filename to Winamp, or multiple file names, you have to put them in quotes: "
Example
winamp.exe /ADD "stupidsong.mp3" "anotherpiratedsong.mp3"
Even when you pass a playlist, it has to be in quotes:
winamp.exe "myplsaylis.m3u"
For my app, to pass multiple files, I generate a temporary playlist, and throw that into winamp.
Platform specific shell commands
If you are developing these platform specific applications, Dont be afraid to use things such as:
Shell("command.com /c dir /b c:\*.mp3s > c:\$$dir.lst")
Its an easy way to get all the files into a list, then you can load that list into whatever array.
The /c on the command.com tells command.com to execute a command (dir, in this instance)
Of course, you can pass Shell() a string, that you built.. Like
CmdStr = "command.com /c dir /b " + PathToMp3 + " > " + TempDirListName
Etc. The > will have it Overwrite the old temp directory list.
Or, if you need to copy files, jsut Shell ("XCOP etc"). Don't be afraid, sure it's not the best way to do things, but it will be behind the scenes, so you don't hvae to waste time reprogramming junk.
If you think these are some bad techniques, wait till you see my sourcecode. You will be like what the hell. I can not make my visual basic code look nice,it makes me sick to see. haha
general stuff
If you are using the MediaPlayer component, the play states are 0 = stop, 1 = paused, 2 = play.
Thats all I can think of for now. Hope this helps someone.
Last edited by Bobby_Aychamo; 10-03-2002 at 01:57 PM.
|
|
|
|
|
|
Advertisement
|
Sponsored links
|
10-03-2002, 02:09 PM
|
#2
|
|
FLAC
Join Date: Aug 1999
Location: Upper Marlboro, MD 20772
Posts: 1,311
|
Ok i hate to be the bad guy here, but this is NOT real programming. First off winamp/media player provides you all the API calls needed...this is more of a shell programming.
I am sure those programming their own interface already know of these API call.
__________________
abcd-1
Author of CobraI,II,III and now CobraIV.
You can contact me on AOL instant messenger....nick is cenwesi or cenwesi3
|
|
|
10-03-2002, 02:26 PM
|
#3
|
|
Low Bitrate
Join Date: Sep 2002
Location: aychamo land
Posts: 92
|
I beg to differ.
Using the MediaPlayer component is a great way to display video files.
Unless you wrote your own routine to open a .mpeg, and wrote your own codec to play mpeg movies, then you haven't really done anything more impressive.
It's easy to hide the mediaplayer component so that most people wouldn't even know it was ever ran.
I chose WinAmp to play the .mp3s because of the great AVS in WinAmp, I think that would look great while playing music. I could have just as easily downloaded one of the 10,000 components or procedures to play .mp3 files.
There's not much difference in what method you choose to play the files, as I really doubt that any of us are writing our own components, FROM SCRATCH, to open an mpeg, decode it, and play it through the sound hardware. Anyone who is is totally wasting their time, and it will never be as good as what is available.
If you are talking about that I'm not actually doing programming, heres a picture of my Song browser. I could easily just have it play the song in here, but I choose to use WinAmp so that I can see the AVS screens
When you click on a playlist, it loads the playlist into the window on the left. Whatever songs you pick on the left, when you Play or Enque, it loads them all into WinAmp. You have the ability to create and save custom playlists, and play songs from certain playlists, etc.
Keep in mind this is also only a days worth of work (we've had a hurrican today, i've been up since 4am, we went driving around during the hurrican to see if anyone was hurt or stuck anywhere to help out, pull trees, etc, so i haven't done much today to it).
Having my music selector sort by Album, or whatever, it's not a big problem.
What I meant in my part about doing stuff like Shell() was that if you are doing it foryourself, it stupid to waste time on crap like using object oriented file system components.
I've looked at what Cobra had in its function list, and nothing there seemed any more complicated in what I have done in a day. ANd Cobra said it uses WinAmp and WindowsMediaPlayer.
Anyways, its for my own use Anyway. We'll see .
|
|
|
10-03-2002, 02:28 PM
|
#4
|
|
Low Bitrate
Join Date: Sep 2002
Location: aychamo land
Posts: 92
|
ANd dont freakiing laugh because I have 2 98 Degress MP3s
|
|
|
10-03-2002, 02:50 PM
|
#5
|
|
Constant Bitrate
Join Date: Feb 2001
Location: Somerville, MA
Posts: 149
|
You can do a few more things using the post/sendmessage API though, including (with some trickery) getting the name of the current song and stuff like that.
I'm not knocking what you have so far. I also am writing my own software, and I appricate how hard it is to get everything layed out just right. :-)
Twostep
|
|
|
10-03-2002, 02:59 PM
|
#6
|
|
Maximum Bitrate
Join Date: Mar 2001
Location: Cincinnati, OH USA
Posts: 694
|
Cenwesi I don't think he really knows what an API is. Bobby, what cenwesi ment was that you can get a whole lot more functionality using the API (which was made for programmers to use), instead of passing everything though the command line. But since this software is for your own use, it doesn't really matter. But we are just making people aware that there is a better way of doing it.
__________________
http://www.mp3car.com/usersites/Maveric/ M.A.V.I.C. System
Asus MB, PII 266, 192 MB Ram, 6.8" LCD, 6 Disk CD-ROM, 21 Gig HD, All-in-Wonder Video w/ TV Tuner, Irman, Windows ME, Winamp, Cobra III -- All in a custom acrylic case.
http://www.mp3car.com/usersites/listings/ MP3car Listings - Please add to it! :)
|
|
|
10-03-2002, 03:27 PM
|
#7
|
|
Low Bitrate
Join Date: Sep 2002
Location: aychamo land
Posts: 92
|
...
In my post, you can read about where I talk quickly on the play states of the media player.
I used the Media Player component, without any command line, to play my video files. I may use this to also play .mp3 files, and it would use no external programs.
When I load WinAmp, I use the ShellExecute function that everyone uses from Shell32.lib
The reason I am so dead set on on WinAmp is for the AVS. Does anyone know a way to load the WinAmp AVS separate from WinAmp? Hell, I would prefer, for my own sakes, to not have to use WinAmp at all, but I want those dang AVS!!
I do know what API calls are, and how they work. I simply don't need that level of integration of WinAmp in my program. Mine will load Arby's winamp skin , etc, on top of my player. So what good would it be for my program to get any info from Winamp, or vice versa? I woudlnt need winamp thugh at all if I could figure a way to use the AVS  (I love them, obviously)
Anyways ...
|
|
|
10-03-2002, 07:00 PM
|
#8
|
|
FLAC
Join Date: Aug 1999
Location: Upper Marlboro, MD 20772
Posts: 1,311
|
lol...thanks mav... it seems like he still doesnt get it. If you know about API you can change the plugins.... hint go to winamp.com in their discussion section.
__________________
abcd-1
Author of CobraI,II,III and now CobraIV.
You can contact me on AOL instant messenger....nick is cenwesi or cenwesi3
|
|
|
10-03-2002, 07:01 PM
|
#9
|
|
Maximum Bitrate
Join Date: Mar 2001
Location: Cincinnati, OH USA
Posts: 694
|
Huh?
We all understand that you love WinAmp (as do I), for it's AVS (I have made a few packs in my time). No one is dissing WinAmp as most people here use it, myself included. And you can't use AVS without WinAmp as that is where it gets it's input from, believe me I have looked into this too.
Quote:
Anyone interested in helping with this thread, kinda as a "database" for people who are developing their front-ends to the car MP3 Players?
Quote:
Mine will load Arby's winamp skin , etc, on top of my player. So what good would it be for my program to get any info from Winamp, or vice versa?
If you load Winamp3 w/ Arbys skin on top of your front-end, then what is your "player" for? If you are going to develop a "front-end" then you don't really want to see Winamp, and you would want to take all the info from Winamp to use in your "front-end". That is what the APIs are for.
__________________
http://www.mp3car.com/usersites/Maveric/ M.A.V.I.C. System
Asus MB, PII 266, 192 MB Ram, 6.8" LCD, 6 Disk CD-ROM, 21 Gig HD, All-in-Wonder Video w/ TV Tuner, Irman, Windows ME, Winamp, Cobra III -- All in a custom acrylic case.
http://www.mp3car.com/usersites/listings/ MP3car Listings - Please add to it! :)
|
|
|
10-03-2002, 09:47 PM
|
#10
|
|
Low Bitrate
Join Date: Sep 2002
Location: aychamo land
Posts: 92
|
Re: Huh?
Quote:
Originally posted by Maveric
If you load Winamp3 w/ Arbys skin on top of your front-end, then what is your "player" for? If you are going to develop a "front-end" then you don't really want to see Winamp, and you would want to take all the info from Winamp to use in your "front-end". That is what the APIs are for.
Actually, you have a very good point. When I went to go take my nap (I just wokeup from a 4.5 hour nap, and its 9:30, how am I going to go back to sleep? /sigh), I thought "God it does suck to have to load WinAmp on top of my front-end." My song picker and playlist maker works so easliy, I've been using it when I am doing non-programming things, just to Que up songs to listen to.
Soo. I think I will rid myself of the WinAmp front-end. It's not a big deal to do, so it looks like I'm up all night again (University is cancelled tomorow because of the hurricane. I will still use WinAmp. Is there a way to use the WinAmp API to start the AVS Screen in Full-Screen mode? I would rather know now if this is possible, instead of trying for hours to find out its not
What angered me, and why I posted so much, is that "someone" posted a message, saying that what I was doing was not real programming, without having a clue what all my program did, just because I said I loaded WinAmp instead of API-ing it.
That's like saying you aren't a real man because I coulnd't bench press 300 pounds. Or that I'm not a real man because I didn't compete in the Iditarod in Alaska, even though I was in Alaska.
Anyways.. (<-- Pattented Sig)
|
|
|
10-03-2002, 11:31 PM
|
#11
|
|
Maximum Bitrate
Join Date: Mar 2001
Location: Cincinnati, OH USA
Posts: 694
|
Actually I agree with what Cenwesi said. What you were doing to send commands to Winamp was not real programming. You were just sending a command line action to it.
Quote:
Example
winamp.exe /ADD "stupidsong.mp3" "anotherpiratedsong.mp3"
You can paste that same line into the run dialog and it will work. That is not programming!
And I know with Winamp2 you couldn't really control AVS with the API. It may be different for Winamp3 though.
__________________
http://www.mp3car.com/usersites/Maveric/ M.A.V.I.C. System
Asus MB, PII 266, 192 MB Ram, 6.8" LCD, 6 Disk CD-ROM, 21 Gig HD, All-in-Wonder Video w/ TV Tuner, Irman, Windows ME, Winamp, Cobra III -- All in a custom acrylic case.
http://www.mp3car.com/usersites/listings/ MP3car Listings - Please add to it! :)
|
|
|
10-03-2002, 11:38 PM
|
#12
|
|
Low Bitrate
Join Date: Sep 2002
Location: aychamo land
Posts: 92
|
roflamo
I'm looking in what people use to access the WinAmp API for VisualBasic, and here is the WinAmp API OpenFile command that is posted and support by Nullsoft on their website:
Public Function WinAMP_OpenFile(strFilename As String) As Boolean
'----------------------------------------------------'
'Causes WinAMP to open the file specified by filename'
'----------------------------------------------------'
Dim ReturnValue As Double
If FileExists(strFilename) Then
ReturnValue = Shell(WINAMP_PATH & " /ADD " & vbQuote & strFilename & vbQuote, vbMinimizedNoFocus)
If ReturnValue 0 Then
WinAMP_OpenFile = True
Else
WinAMP_OpenFile = False
End If
Else
WinAMP_OpenFile = False
End If
End Function
Yes I see all the simple API calls to Get and Set the Track #, Volume, position, etc. But it's funny to me the accepted way in the API to start WinAmp and load a playlist is "not real programming."
And yes.. I am aware of doing it like this:
Public Sub AddFile(filename As String, waclass As String)
hWndWinamp = FindWindow(waclass, 0)
If hWndWinamp = 0 Then 'can't find Winamp
Exit Sub
End If
Dim cds As COPYDATASTRUCT
cds.dwData = waAddFile
' = 100 (IPC_PLAYFILE)
cds.lpData = lstrcpy(filename, filename)
cds.cbData = Len(filename) + 1
RetVal = CopyDataSendMessage(hWndWinamp, WM_COPYDATA, 0&, cds)
End Sub
--
So, according to you guys's standards, when I am coding my FrontEnd to invisible WinAmp,
If I type:
WinAmp_OpenFile("ihatebritneyspears.mp3")
Then I am not programming.
But if I type:
AddFile("Everybeatlessongever.mp3")
Then I am programming?
..
Last edited by Bobby_Aychamo; 10-03-2002 at 11:48 PM.
|
|
|
10-04-2002, 01:21 AM
|
#13
|
|
Low Bitrate
Join Date: Sep 2002
Location: aychamo land
Posts: 92
|
Well, I did an API call to have it start the Full Screen Visual manager.
And it does of course have to use winAmp, but winamp stays invisible, but the problem is, when I exit from the full screen viusal plugin, it gives WinAmp focus  doh!
Last edited by Bobby_Aychamo; 10-04-2002 at 01:57 AM.
|
|
|
10-04-2002, 03:31 AM
|
#14
|
|
Newbie
Join Date: Sep 2002
Location: Brisbane, Queensland, Australia
Posts: 21
|
Ok I have a question
I'm writing my own frontend in VB.
How do I pass quotes in vb?
for example, if i type
shell "C:\program files\winamp\winamp.exe D:\a pirate song.mp3"
then I get a playlist like this:
D:\a
pirate
song.mp3
Yet if I type this,
shell "C:\program files\winamp\winamp.exe "D:\a pirate song.mp3" "
I get a syntax error
|
|
|
10-04-2002, 03:36 AM
|
#15
|
|
Raw Wave
Join Date: Apr 2000
Location: Surrey, UK
Posts: 2,070
|
Quote:
Originally posted by Bobby_Aychamo
There's not much difference in what method you choose to play the files, as I really doubt that any of us are writing our own components, FROM SCRATCH, to open an mpeg, decode it, and play it through the sound hardware. Anyone who is is totally wasting their time, and it will never be as good as what is available.
I ported mpg123 to DOS, modified it a bit, and then wrote the sound driver that does all the ping pong dma stuff and programming the sound chip. Does that count? The source is on my site if you want proof.
Rob
__________________
6yr old first install died 20/8/2005 as result of bad bios flash.
New system : 6x5x2" contains 1GHz C3 PCM9373, ISR based PSU, 8Gb flash DOM, 98Lite, DirectShow based frontend.
GPS : Rikaline 6010.
Display : LTM08C351 + LVDS receiver.
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:50 AM.
| |