Page 1 of 2 1 2 LastLast
Results 1 to 30 of 55

[RELEASE] OpenSource File browser

This is a discussion on [RELEASE] OpenSource File browser within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hi guys, I've been working on a file browser last summer, and now, it has been finished for quite a ...

  
  1. #1
    QJ Gamer Blue
    Points: 4,938, Level: 44
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Paris
    Posts
    217
    QJ Pts
    4,938
    Level
    44
    Downloads
    0
    Uploads
    0

    Smile [RELEASE] OpenSource File browser

    Hi guys,
    I've been working on a file browser last summer, and now, it has been finished for quite a while, and I haven't a clue of what I could use it for...
    So, I just thought I would release the source code under GPL, so that other people can use it.

    Here are the few features that makes it a little more than a basic fil browser:
    -It has different themes you can change into the option menu
    -The display is made in a Rolodex style presentation, dunno if it means what I mean, but that's basically the same idea as Art used in his xflash (but coded from scratch). So, I like it :)
    -Other small stuff you'll discover.

    So, for any non developer, this is kind of a useless stuff, because if you run the eboot which is in the zip, you'll have a very nice file browser, but which won't do anything when you select a fle...

    So, if you do are a dev, just modify it a little, just adding the action you want to apply to the file selected, or modify it a lot, just remember to release it under gpl too, and to quote the author (myself :))
    Of course, It'd be great if anyone using the source coud send a little mail to show me how they used it, I would love that!

    Here are is a screenshot of the browser with the default theme more are available on my flickr page.




    Don't hesitate to send a mail here: [email protected]
    And, visit my web blog

    Download Source Code & (useless) Binaries


    Last edited by maxthebest; 10-01-2008 at 12:20 PM.

  2. #2
    Points: 2,337, Level: 29
    Level completed: 25%, Points required for next Level: 113
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Join Date
    Aug 2008
    Posts
    1
    QJ Pts
    2,337
    Level
    29
    Downloads
    0
    Uploads
    0

    Default

    Sympa max ;)

  3. #3
    QJ Gamer Blue
    Points: 4,938, Level: 44
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Paris
    Posts
    217
    QJ Pts
    4,938
    Level
    44
    Downloads
    0
    Uploads
    0

    Default

    Merci :)

  4. #4
    QJ Gamer Bronze
    Points: 4,784, Level: 44
    Level completed: 17%, Points required for next Level: 166
    Overall activity: 0%

    Join Date
    Jul 2005
    Location
    Canada
    Posts
    88
    QJ Pts
    4,784
    Level
    44
    Downloads
    3
    Uploads
    0

    Default

    maxthebest:
    Generally this "rolling way" is called a "rolodex" style presentation (if you ask me, and yeah I remember when rolodexes were still the iPhone/pda of the year gizmo.) See here for an example image of a now seemingly ancient (but surprisingly still not hard to find) uber desktop item.

  5. #5
    NetGameOrb Maker
    Points: 6,138, Level: 50
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Jan 2008
    Location
    New York
    Posts
    683
    QJ Pts
    6,138
    Level
    50
    My Mood
    Cheerful
    Downloads
    2
    Uploads
    0

    Default

    maxthebest,cool thanks for giving the source code. it may be helpful for some people here.
    GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.

    Stats Blog:http://netgameorb.blogspot.com/
    Website:http://www.netgameorb.com/

  6. #6
    QJ Gamer Blue
    Points: 4,938, Level: 44
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Paris
    Posts
    217
    QJ Pts
    4,938
    Level
    44
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by cory1492 View Post
    maxthebest:
    Generally this "rolling way" is called a "rolodex" style presentation (if you ask me, and yeah I remember when rolodexes were still the iPhone/pda of the year gizmo.) See here for an example image of a now seemingly ancient (but surprisingly still not hard to find) uber desktop item.
    Oh! thanks a lot, that's exactly what I meant, post edited :)

    Quote Originally Posted by thecobra View Post
    maxthebest,cool thanks for giving the source code. it may be helpful for some people here.
    You're welcome, I hope it will be useful to someone :)

  7. #7
    QJ Gamer Blue
    Points: 3,795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27.0%

    Join Date
    Jul 2007
    Posts
    296
    QJ Pts
    3,795
    Level
    38
    Downloads
    0
    Uploads
    0

    Default

    A few reasons why I wouldn't use this:

    1. There is no modularity. Everything is thrown together into one sourcefile, which, granted, will run out the box and show people how it works. However, there is not sense of being able to copy and paste the code and use it in my own project, which is the point of a library. This would be fine if it was specifically built just to make file browsing easier, but as it stands, this would be one PITA to integrate into my own project.
    2. Do not define pspDebugScreenPrintf() to printf(). They are not the same thing. Even concept wise they do not do the same thing. The standard C function printf() is used to print text to the Standard Output, or stdout. pspDebugScreenPrintf(), rather, is used to print debug text to the PSPs screen, in software. Not only is this slow, its name pretty much sums it up. It is part of the pspDebug library, which is used for debugging, and if you are releasing this to the public it should be far away from the beta/debug stage. (Also, no, I understand that you will always be debugging something, but you shouldn't release something that uses a debug library to the public.)
    3. Use snprintf() rather than sprintf(). It's safer, and takes just one extra parameter, the length of the buffer so that it does not overrun it.
    4. You are using the standard C file IO library in this. This may be good for portability, sure. But on the PSP speed is usually the key and it is MUCH faster to use the native librarys (sceIo*) rather than use the newlib wrappers for them.
    5. Holy hell, globals. Get rid of them. They are evil.
    6. You aren't using meaningful variable names. How should you expect someone to use this without knowing what the variables 'a', 'IRS', 'file', 'osel, 'fosel', and 'but' do?
    7. You should either A) Prefix your functions with a specfic, unique prefix to avoid duplicate function names, or B) Compile with g++ and use a namespace.
    8. You have a whole lot of hardcoded nonsense going on in the current selection and printing of the files part of your code, You should go over that and use a loop to improve readability.
    9. Try generating the colors manually, so that you aren't limited to the fixed amount of theme options you have there.
    10. Declare variables when you need them rather than at the very top of the file so you don't have you continuously scroll up to see which variable is which.
    11. DO NOT INCLUDE SOURCE FILES. That's what header files are for. Never, ever, ever, ever #include a .c file. Ever. Ever. Ever. Ever.
    12. Use consistant function names. Don't have one function called This_Is_A_Function() and another called ohheythisisalsoafunction( ). Pick one and stick to it, it will improve readability. Consistancy is always good.


    Well, good luck with this. I hope you don't take any of the above personally, I'm only trying to help.

  8. #8
    QJ Gamer Blue
    Points: 4,938, Level: 44
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Paris
    Posts
    217
    QJ Pts
    4,938
    Level
    44
    Downloads
    0
    Uploads
    0

    Default

    Well, thanks a lot for all of this, I' taking notes of this...
    But, first, it first was a personal project, so, the variables names are very understandable for me, and that's all I cared about.
    I is not meant to be any kind of library, it's just a code sample I thought I wuld use, but didn't (yet), and any programer can use this in his text, as the tittle suggests, it's an open source file browser, and not a file browser library.
    About the debug stuff, I think that everyone uses the debug library for printing... maybe it's not great, but it works for me... and I don't know any other ways to print text.
    About including *.c files, I know it's evil, but well, it was easuer for me, and ... it works, lol
    What do you mean by generating manually colors?

    Anyways, thanks again, I'll try to remember that, but I have to say, about the variable names and place of declaration: I guess it depends on the programmer's choice, I feel like it's esier to have all the declarations at the same place, so, you know where to look for it.

  9. #9
    QJ Gamer Silver
    Points: 8,475, Level: 62
    Level completed: 9%, Points required for next Level: 275
    Overall activity: 0%

    Join Date
    Sep 2006
    Location
    Perth, Scotland
    Posts
    1,094
    QJ Pts
    8,475
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    Globals are slower than local vars.

  10. #10
    QJ Gamer Silver
    Points: 10,263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Join Date
    Jun 2006
    Location
    UK
    Posts
    2,326
    QJ Pts
    10,263
    Level
    67
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Davee View Post
    Globals are slower than local vars.
    Not necessarily but it does help the compiler optimise better at times. There are also some rare cases where using a global over a local variable can make it run faster.

    @maxthebest: The advice given is for future reference and to make you a better programmer. Some the advice such as variable naming is more to do with working with other people and making it as easy as possible to work with your code.
    Last edited by FreePlay; 10-01-2008 at 03:17 PM.

  11. #11
    QJ Gamer Blue
    Points: 4,938, Level: 44
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Paris
    Posts
    217
    QJ Pts
    4,938
    Level
    44
    Downloads
    0
    Uploads
    0

    Default

    Yeah, I understand that, and thank all of you very much for that :)
    By the way, noob question: what are globals?

  12. #12
    QJ Gamer Gold
    Points: 17,453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Join Date
    Jul 2005
    Location
    everywhere
    Posts
    3,526
    QJ Pts
    17,453
    Level
    84
    Downloads
    1
    Uploads
    0

    Default

    max, globals are variables declared at the top of the scope of the program

    anyways, globals are not evil when making an damn game, i can understand why their evil in a library, but if your designing a game with a few function's that rely on multiple variables, it's far easier to have a global variable which can be easily accessed from any point in the program, than to have to pass a million parameters though your function
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  13. #13
    QJ Gamer Blue
    Points: 4,938, Level: 44
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Paris
    Posts
    217
    QJ Pts
    4,938
    Level
    44
    Downloads
    0
    Uploads
    0

    Default

    OH, okay, thanks.
    Yeah, it's sometimes easier, but I'll try to do better next time :)
    Thanks again :)

  14. #14
    QJ Gamer Bronze
    Points: 4,784, Level: 44
    Level completed: 17%, Points required for next Level: 166
    Overall activity: 0%

    Join Date
    Jul 2005
    Location
    Canada
    Posts
    88
    QJ Pts
    4,784
    Level
    44
    Downloads
    3
    Uploads
    0

    Default

    max, if you're like me you do what works until you find (or are taught, rather than ridiculed into) a better way ;)

    A short read that I've found quite helpful and touches on a lot of the previous comments, google for the pdf of:
    C & C++ Programming Style Guidelines Fred Richards

  15. #15
    QJ Gamer Blue
    Points: 4,938, Level: 44
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Paris
    Posts
    217
    QJ Pts
    4,938
    Level
    44
    Downloads
    0
    Uploads
    0

    Default

    Okay thanks, I'll check that out ;)

  16. #16
    Developer
    Points: 19,136, Level: 87
    Level completed: 58%, Points required for next Level: 214
    Overall activity: 33.0%

    Join Date
    Dec 2005
    Posts
    1,899
    QJ Pts
    19,136
    Level
    87
    Downloads
    0
    Uploads
    0

    Default

    globals should never be used in programs, in a library it is ok as you only use a few that you realy need as they are not visable to the software when the library is linked.

    that is what you should try and keep to and is what \i try to keep to in my software, too many globals in software can cause major issues as your program grows

  17. #17
    QJ Gamer Silver
    Points: 8,475, Level: 62
    Level completed: 9%, Points required for next Level: 275
    Overall activity: 0%

    Join Date
    Sep 2006
    Location
    Perth, Scotland
    Posts
    1,094
    QJ Pts
    8,475
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by xart View Post
    globals should never be used in programs, in a library it is ok as you only use a few that you realy need as they are not visable to the software when the library is linked.

    that is what you should try and keep to and is what \i try to keep to in my software, too many globals in software can cause major issues as your program grows
    Globals sometimes are a great advantage. For example, most of my arrays are global, as more than one function needs to access them.

  18. #18
    QJ Gamer Silver
    Points: 10,263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Join Date
    Jun 2006
    Location
    UK
    Posts
    2,326
    QJ Pts
    10,263
    Level
    67
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Davee View Post
    Globals sometimes are a great advantage. For example, most of my arrays are global, as more than one function needs to access them.
    Ideally, in that case you should pass it as a parameter to the function that needs it.

  19. #19
    NetGameOrb Maker
    Points: 6,138, Level: 50
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Jan 2008
    Location
    New York
    Posts
    683
    QJ Pts
    6,138
    Level
    50
    My Mood
    Cheerful
    Downloads
    2
    Uploads
    0

    Default

    Quote Originally Posted by yaustar View Post
    Ideally, in that case you should pass it as a parameter to the function that needs it.
    yeah that good but like davee i use global for array and some int variable when it used a lot in my program like for example "file browsing". i usually update the array of file every time i search the dir. also when the user execute a file and also like in 4 or more part of my script that i can't remember right now. but passing them as parameter is also good :)
    GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.

    Stats Blog:http://netgameorb.blogspot.com/
    Website:http://www.netgameorb.com/

  20. #20
    QJ Gamer Blue
    Points: 4,938, Level: 44
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Paris
    Posts
    217
    QJ Pts
    4,938
    Level
    44
    Downloads
    0
    Uploads
    0

    Default

    okay, I'll try to forget about globals, and try as often as I can not to use them.
    Thanks for all those advice!

  21. #21
    QJ Gamer Silver
    Points: 8,475, Level: 62
    Level completed: 9%, Points required for next Level: 275
    Overall activity: 0%

    Join Date
    Sep 2006
    Location
    Perth, Scotland
    Posts
    1,094
    QJ Pts
    8,475
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by yaustar View Post
    Ideally, in that case you should pass it as a parameter to the function that needs it.
    Yes, I know that, I'm not stupid. Sometimes however, it's just not possible to do that.

  22. #22
    QJ Gamer Green
    Points: 3,721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Join Date
    Jan 2008
    Posts
    612
    QJ Pts
    3,721
    Level
    38
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Davee View Post
    Yes, I know that, I'm not stupid. Sometimes however, it's just not possible to do that.
    Such as?
    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

  23. #23
    QJ Gamer Silver
    Points: 8,475, Level: 62
    Level completed: 9%, Points required for next Level: 275
    Overall activity: 0%

    Join Date
    Sep 2006
    Location
    Perth, Scotland
    Posts
    1,094
    QJ Pts
    8,475
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by TurtlesPwn View Post
    Such as?
    Function hooks...

  24. #24
    QJ Gamer Green
    Points: 3,721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Join Date
    Jan 2008
    Posts
    612
    QJ Pts
    3,721
    Level
    38
    Downloads
    0
    Uploads
    0

    Default

    Function hooks aren't commonly used it programs in this sense, but I will agree they are one use for it.
    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

  25. #25
    QJ Gamer Silver
    Points: 8,475, Level: 62
    Level completed: 9%, Points required for next Level: 275
    Overall activity: 0%

    Join Date
    Sep 2006
    Location
    Perth, Scotland
    Posts
    1,094
    QJ Pts
    8,475
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by TurtlesPwn View Post
    Function hooks aren't commonly used it programs in this sense, but I will agree they are one use for it.
    Agreed. I was just trying to justify globals arrays to yaustar ;)

  26. #26
    QJ Gamer Blue
    Points: 4,938, Level: 44
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Paris
    Posts
    217
    QJ Pts
    4,938
    Level
    44
    Downloads
    0
    Uploads
    0

    Default

    Well, I know in some cases it makes it pretty much easier to use globals, because sometimes, you're having troubles passing arrays in parameters (well, I had that kind of problem, dunno why... so I chose the easy way...)

  27. #27
    Developer
    Points: 19,136, Level: 87
    Level completed: 58%, Points required for next Level: 214
    Overall activity: 33.0%

    Join Date
    Dec 2005
    Posts
    1,899
    QJ Pts
    19,136
    Level
    87
    Downloads
    0
    Uploads
    0

    Default

    Globals should never be used in general and you can write software with zero globals, for libs you never going to make any globals if used accessible so globals in lib can in away be ok to a point.

    Any one writing software knows this.
    If you need a global you need to think again about your software code structure.

    I admit I have used globals myself as we have all done it as it is a lazy and quick and dirty hack out of a issue of recoding stuff but if global is used must be address in some stage of development of the software.

    One way you could easly solve your issue is to create a struct then pass it to a function, struct pointers

  28. #28
    QJ Gamer Silver
    Points: 8,475, Level: 62
    Level completed: 9%, Points required for next Level: 275
    Overall activity: 0%

    Join Date
    Sep 2006
    Location
    Perth, Scotland
    Posts
    1,094
    QJ Pts
    8,475
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by xart View Post
    Globals should never be used in general and you can write software with zero globals, for libs you never going to make any globals if used accessible so globals in lib can in away be ok to a point.

    Any one writing software knows this.
    If you need a global you need to think again about your software code structure.

    I admit I have used globals myself as we have all done it as it is a lazy and quick and dirty hack out of a issue of recoding stuff but if global is used must be address in some stage of development of the software.

    One way you could easly solve your issue is to create a struct then pass it to a function, struct pointers
    Once again, function hooks usually require a global. Since you cannot pass vars through.

    For example if you need to check a certain file is opened. You would record the return SceUID into a global. Then when it comes to reading the file you would compare the passed SceUID with the one in the global.

  29. #29
    QJ Gamer Blue
    Points: 3,795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27.0%

    Join Date
    Jul 2007
    Posts
    296
    QJ Pts
    3,795
    Level
    38
    Downloads
    0
    Uploads
    0

    Default

    That is almost completely PSP specific, I doubt he'll be doing anything like that on any other platform.

  30. #30
    QJ Gamer Silver
    Points: 8,475, Level: 62
    Level completed: 9%, Points required for next Level: 275
    Overall activity: 0%

    Join Date
    Sep 2006
    Location
    Perth, Scotland
    Posts
    1,094
    QJ Pts
    8,475
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by _dysfunctional View Post
    That is almost completely PSP specific, I doubt he'll be doing anything like that on any other platform.
    Obviously...

    This is the PSP Development section afterall ;)


 
Page 1 of 2 1 2 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





All times are GMT -8. The time now is 09:10 AM.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .