| View previous topic :: View next topic |
| Author |
Message |
xgumbi
Joined: 31 Jul 2008 Posts: 5
|
Posted: Thu Jul 31, 2008 2:40 am Post subject: 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 :) _________________ Gimme Toro, Gimme Some More!! |
|
| Back to top |
|
 |
ne0h
Joined: 21 Feb 2008 Posts: 386
|
Posted: Thu Jul 31, 2008 4:05 am Post subject: |
|
|
Use a simple "while (sceIoDread(fd, &a_dir) > 0)", this function is documented in the pspsdk..
( If you want to scan all the MS I think that you have to build a recursive function... ;) ) |
|
| Back to top |
|
 |
Hellcat
Joined: 24 Jan 2007 Posts: 84
|
Posted: Thu Jul 31, 2008 4:07 am Post subject: |
|
|
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.... |
|
| Back to top |
|
 |
xgumbi
Joined: 31 Jul 2008 Posts: 5
|
Posted: Thu Jul 31, 2008 4:49 am Post subject: |
|
|
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, _________________ Gimme Toro, Gimme Some More!! |
|
| Back to top |
|
 |
Hellcat
Joined: 24 Jan 2007 Posts: 84
|
Posted: Thu Jul 31, 2008 5:22 am Post subject: |
|
|
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 :) |
|
| Back to top |
|
 |
xgumbi
Joined: 31 Jul 2008 Posts: 5
|
Posted: Thu Jul 31, 2008 7:58 am Post subject: |
|
|
Awesome, thanks Hellcat. A code sample would be great.
If i hit any snags I'll be sure to post. _________________ Gimme Toro, Gimme Some More!! |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Jul 31, 2008 9:51 am Post subject: |
|
|
| xgumbi wrote: | Awesome, thanks Hellcat. A code sample would be great.
If i hit any snags I'll be sure to post. |
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. |
|
| Back to top |
|
 |
xgumbi
Joined: 31 Jul 2008 Posts: 5
|
Posted: Thu Jul 31, 2008 11:45 am Post subject: |
|
|
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. _________________ Gimme Toro, Gimme Some More!! |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Jul 31, 2008 12:15 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
xgumbi
Joined: 31 Jul 2008 Posts: 5
|
Posted: Thu Jul 31, 2008 3:49 pm Post subject: |
|
|
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. _________________ Gimme Toro, Gimme Some More!! |
|
| Back to top |
|
 |
Cpasjuste
Joined: 29 May 2005 Posts: 214
|
Posted: Thu Jul 31, 2008 5:04 pm Post subject: |
|
|
| J.F is boring :) |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Jul 31, 2008 8:00 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Thu Jul 31, 2008 9:10 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Maxiime
Joined: 19 Jun 2008 Posts: 18
|
Posted: Fri Aug 01, 2008 7:34 am Post subject: |
|
|
@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
Last edited by Maxiime on Fri Aug 01, 2008 7:47 am; edited 1 time in total |
|
| Back to top |
|
 |
Maxiime
Joined: 19 Jun 2008 Posts: 18
|
Posted: Fri Aug 01, 2008 7:40 am Post subject: |
|
|
| xgumbi wrote: | | 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. |
Totally agreed.
I'm thinking the same (like many other people here)
Cyaa
(Srry for double-post) |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Fri Aug 01, 2008 8:25 am Post subject: |
|
|
| 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. |
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.
| Quote: | | JF, YOU should be banned. You have 1933 posts, probable 'figure it out yourself' or spam posts |
You clearly have no idea what is done here and by whom. Again, shut your pie hole you stupid noobie. |
|
| Back to top |
|
 |
Maxiime
Joined: 19 Jun 2008 Posts: 18
|
Posted: Fri Aug 01, 2008 8:48 am Post subject: |
|
|
@jf : Oh, so this forun is not for noobs? Euhm. . Where did you read that ? Is it written in the logo 'not for noobs' ?
Go home and shut up with your f*cking own rules. Everyone is flaming you. Plz accept what we're saying. Thank you.
Cyaa |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Fri Aug 01, 2008 9:03 am Post subject: |
|
|
Locked because of excessive llamadrama.
Try to be nice to each other, folks. |
|
| Back to top |
|
 |
|