Browsing and Moving Files on Memstick C++, Playlist Selector
Browsing and Moving Files on Memstick C++, Playlist Selector
Hi all, just some quick questions if anyone can help me out.
I'm new to PSP development, but I've been programming for a few years now in other languages so I don't need hand holding, just need some pointers.
I've never been real happy with the PSP's mp3 playlist support. As you probably know you can only have one playlist per folder. So I've written a simple program that lets me swap out the current playlist in my mp3 folder. I have all my mp3's in one folder /MUSIC/Tunes and all the playlists right under the /MUSIC folder.
It works fine and I'm happy with it, but I'd like to improve it. Currently all my playlists are hard coded into the app, so each time i create or add a new playlist i need to add it to the code and recompile. Ideally I'd like to dynamically search the /MUSIC folder for playlists (.m3u) files and display them for the user to select the one they want. Or even better, Id like to incorporate a simple file browser so the user can save playlists on the memstick wherever they want and browse to them.
This is where i'm stumped, I'm not sure how to do this on the PSP. Any ideas? Thanks in advance :)
I'm new to PSP development, but I've been programming for a few years now in other languages so I don't need hand holding, just need some pointers.
I've never been real happy with the PSP's mp3 playlist support. As you probably know you can only have one playlist per folder. So I've written a simple program that lets me swap out the current playlist in my mp3 folder. I have all my mp3's in one folder /MUSIC/Tunes and all the playlists right under the /MUSIC folder.
It works fine and I'm happy with it, but I'd like to improve it. Currently all my playlists are hard coded into the app, so each time i create or add a new playlist i need to add it to the code and recompile. Ideally I'd like to dynamically search the /MUSIC folder for playlists (.m3u) files and display them for the user to select the one they want. Or even better, Id like to incorporate a simple file browser so the user can save playlists on the memstick wherever they want and browse to them.
This is where i'm stumped, I'm not sure how to do this on the PSP. Any ideas? Thanks in advance :)
Gimme Toro, Gimme Some More!!
RightDirection* ThereYouGo;
There you have your pointer :p
Yah, bad joke, I know, sorry.... here something (hopefulle) more helpfull ;)
You can use sceIoDopen() to open a directory and sceIoDread() to "scan" through the directories entries.
(every call of sceIoDread() puts the next entry into the structure passed to it, when it reached the end of the dir entries it returns 0.)
To determine if you hit a file or a (sub)folder you can use sceIoGetStat().
In the structure it returns, look at the st_mode value, if bit 0x2000 is set, it's a file, is 0x1000 set, then it's another (sub)folder.
All theese functions are documented pretty well in the SDKs include "pspiofilemanager.h" - or similar, if memory servs right now :)
[edit]
whooops, a few seconds too late....
There you have your pointer :p
Yah, bad joke, I know, sorry.... here something (hopefulle) more helpfull ;)
You can use sceIoDopen() to open a directory and sceIoDread() to "scan" through the directories entries.
(every call of sceIoDread() puts the next entry into the structure passed to it, when it reached the end of the dir entries it returns 0.)
To determine if you hit a file or a (sub)folder you can use sceIoGetStat().
In the structure it returns, look at the st_mode value, if bit 0x2000 is set, it's a file, is 0x1000 set, then it's another (sub)folder.
All theese functions are documented pretty well in the SDKs include "pspiofilemanager.h" - or similar, if memory servs right now :)
[edit]
whooops, a few seconds too late....
great! thanks for the tips guys.
@Hellcat: I think these functions are exactly what i was looking for. Thanks for the pointer lol
P.S. Is there any online documentation for these I/O functions? ... I know, google is my friend ;) but if you know any off hand that'd be cool. I'll check out that header file when i get home today, hopefully this weekend i'll have some time to revise my app.
Thanks again,
@Hellcat: I think these functions are exactly what i was looking for. Thanks for the pointer lol
P.S. Is there any online documentation for these I/O functions? ... I know, google is my friend ;) but if you know any off hand that'd be cool. I'll check out that header file when i get home today, hopefully this weekend i'll have some time to revise my app.
Thanks again,
Gimme Toro, Gimme Some More!!
I think the header include is all the documentation you need.
The parameters of the functions are briefly, but to the point, explained and the struct definitions are present in their full beauty :)
If you have any questions left, don't hasitate to ask, I used those functions a lot myself lately for very similar things.
When I get back to my own comp, I can post a code snipped as well :)
The parameters of the functions are briefly, but to the point, explained and the struct definitions are present in their full beauty :)
If you have any questions left, don't hasitate to ask, I used those functions a lot myself lately for very similar things.
When I get back to my own comp, I can post a code snipped as well :)
There is already TONS of sample code using directory commands out there! Nearly every homebrew out uses a file requester, and hence has sample code on getting directories. I suggest you just take a look at the existing code. SHEESH! Noobies... can't live with 'em, not allowed to fire them into the sun.xgumbi wrote:Awesome, thanks Hellcat. A code sample would be great.
If i hit any snags I'll be sure to post.
Hey c'mon man, if you don't ask questions you don't get answers. And I'm sure you were new to this once too.
I've been in an Oracle shop for the last 4 years and I don't think any less of my co workers when they ask me for help on topics they've never had any exposure to, no point in re-inventing the wheel.
Anyway, thanks for the help Hellcat, ne0h. I've gone over the documentation on these functions and it's pretty straight forward. I've already pseudo'd my changes, I just created this post to get a shove in the right direction.
I've been in an Oracle shop for the last 4 years and I don't think any less of my co workers when they ask me for help on topics they've never had any exposure to, no point in re-inventing the wheel.
Anyway, thanks for the help Hellcat, ne0h. I've gone over the documentation on these functions and it's pretty straight forward. I've already pseudo'd my changes, I just created this post to get a shove in the right direction.
Gimme Toro, Gimme Some More!!
I was once new, but I didn't ask questions like "How do I read a directory?" That's OBVIOUS and there are (and were) TONS of examples out there. I wanted to know how to read directories as well when I first started, so I simply looked at the code for an open source PSP program that had a file requester. DUH!!! In fact, the majority of PSP questions can be answered by looking at already written programs. If you're too lazy to look at a single app, don't expect us to go easy on you.
It's okay, I'm no longer bothered by your responses. I've been reading some of your other posts and it's usually the same thing "go figure it out for yourself". You're that guy who did figure it out for himself and doesn't want anyone else to have an easier time than you did.
Instead of just saying "do it yourself", maybe list some resources that you've found to be helpful in your experience. I mean, that's the whole benefit of going to someone with more experience than you, they know more. I clearly said I wasn't looking for hand holding, just direction.
With work and family, I'm a busy guy. So rather than spending valuable time finding and then hunting through the source of other ppl's apps for something that I suspected would be relatively simple, I came here looking for a simple answer to a simple question, not criticism from arrogant vets. Don't bother responding to posts from inexperienced PSP developers if you're just going to belittle them. Constructive criticism dude, look it up.
Besides, I never intended on going all out with PSP development, I don't have the time to invest. I just wanted to improve my PSP as an mp3 player, since that's one of my primary uses for it. I thought this would be a fun, short little side project for me. And it has been... mostly.
In any case, I've finished my app and I'm pretty happy with it now. Thanks for the help Hellcat.
I won't be revisiting this, so newbie flame away J.F. The floor is yours.
Instead of just saying "do it yourself", maybe list some resources that you've found to be helpful in your experience. I mean, that's the whole benefit of going to someone with more experience than you, they know more. I clearly said I wasn't looking for hand holding, just direction.
With work and family, I'm a busy guy. So rather than spending valuable time finding and then hunting through the source of other ppl's apps for something that I suspected would be relatively simple, I came here looking for a simple answer to a simple question, not criticism from arrogant vets. Don't bother responding to posts from inexperienced PSP developers if you're just going to belittle them. Constructive criticism dude, look it up.
Besides, I never intended on going all out with PSP development, I don't have the time to invest. I just wanted to improve my PSP as an mp3 player, since that's one of my primary uses for it. I thought this would be a fun, short little side project for me. And it has been... mostly.
In any case, I've finished my app and I'm pretty happy with it now. Thanks for the help Hellcat.
I won't be revisiting this, so newbie flame away J.F. The floor is yours.
Gimme Toro, Gimme Some More!!
So YOUR time is more valuable than ours? WE should have to search the threads and examples so you don't have to??? Will a mod PLEASE ban this a-hole? He's even smug about it!
Hellcat, I'm warning you. Help one more a-hole like this and I'll push to have YOU banned as well. This is EXACTLY the kind of crap we don't need here. Poeple like this need to be nipped in the bud or we'll be flooded with pretentious jerks who think their time is more valuable than ours.
Hellcat, I'm warning you. Help one more a-hole like this and I'll push to have YOU banned as well. This is EXACTLY the kind of crap we don't need here. Poeple like this need to be nipped in the bud or we'll be flooded with pretentious jerks who think their time is more valuable than ours.
just a quick comment before this gets locked out (because it will be...)... i think that IF and only IF moderators get a little more rough kicking in the a** those stupid little kids only wanting to play the "great hacker" part, we all could get more relaxed and answer more kindly to people really wanting to learn. This is a dev board indeed, but this doesn't mean that only super-professional can access it; but i repeat: don't be afraid of banning or reproach idiot people....the mood of good willing people cannot but improve.
@J.F : Do you know what a forum is? No, i don't think so.
A forum is a place to help each other.
Not to flame people who are asking questions wich are stupid for YOU.
Printing "Hello world" can be a dream for a beginner. Not for you(Normally).
Saying 'noob', 'learn programming first', etc is very lazy. If you don't know the answer on a question, then shut up and stop spamming.
JF, YOU should be banned. You have 1933 posts, probable 'figure it out yourself' or spam posts
Cyaa
A forum is a place to help each other.
Not to flame people who are asking questions wich are stupid for YOU.
Printing "Hello world" can be a dream for a beginner. Not for you(Normally).
Saying 'noob', 'learn programming first', etc is very lazy. If you don't know the answer on a question, then shut up and stop spamming.
JF, YOU should be banned. You have 1933 posts, probable 'figure it out yourself' or spam posts
Cyaa
Last edited by Maxiime on Fri Aug 01, 2008 7:47 am, edited 1 time in total.
Do you know what THIS forum is for? Obviously not. Forums have different purposes, and THIS FORUM is NOT to help noobies. Never has been, never will be. You're also clearly a noobie, so shut the hell up or go away.Maxiime wrote:@J.F : Do you know what a forum is? No, i don't think so.
A forum is a place to help each other.
Not to flame people who are asking questions wich are stupid for YOU.
Printing "Hello world" can be a dream for a beginner. Not for you(Normally).
Saying 'noob', 'learn programming first', etc is very lazy. If you don't know the answer on a question, then shut up and stop spamming.
You clearly have no idea what is done here and by whom. Again, shut your pie hole you stupid noobie.JF, YOU should be banned. You have 1933 posts, probable 'figure it out yourself' or spam posts