Kinetic Scrolling Demo **Updated** KListControl with source

Search This thread

dosfan

Member
Sep 17, 2007
9
0
Hi

New around these forums..

I've posted a in-progress of a project I'm working on. It's a kinetic scroller (you know that flick scroll effect). Remember this is a demo it doesn't actually do anything useful apart from amuse me!

Not as fluid/cool as iContact, but it's my first PPC application. The grand plan is to turn it into a library based MP3 player with a decent looking interface.

It's written in CF .NET so if you really need the source reflection is your friend.

Tested on a WM6 blueangel device @ 400Mhz. Runs in the WM2003 emulator

----

I've updated with source. No license, do whatever you want with it. Although a mention somewhere would be nice ;)

Chad get this media player out the door now!

-------
New optimized demo released, source now updated.
Removing old source as the file name is confusing.

Thanks for all the comments.
-------------------------------------------------
**************************************
UPDATE:
gingercat has done some fantastic work loosely based on the original source and created a user control. Unlike my old code it doesn't use one big bitmap and just better written in every aspect. I'll leave my old source up just for reference as to how /not/ to write a kinetic scroller ;)
 

Attachments

  • Scroller-002-source.zip
    558.8 KB · Views: 3,617
  • KListControl.zip
    5.6 KB · Views: 2,745
Last edited:

jackbnymbl

Senior Member
Apr 24, 2007
69
0
I can't try it right now because I don't have my device, but it's nice to know that at least a few people still support WM2003/SE...
 

thundershadow14

Senior Member
Aug 10, 2007
478
0
LOVELY! Why don't we work together to bring your scrolling routine, into my existing mp3 player "Melody". I've got playback and that sort of thing sorted out. Please PM me if you're interested.
 

salahnajm

Senior Member
Jul 10, 2007
93
0
slow scrolling and not as responsive as other scrolling software out there... but the idea is there :D ... i would also love to see smtg similar implemented in chad's media player (just my simple opinion)...
 

dosfan

Member
Sep 17, 2007
9
0
LOVELY! Why don't we work together to bring your scrolling routine, into my existing mp3 player "Melody". I've got playback and that sort of thing sorted out. Please PM me if you're interested.

Thanks for the offer! This is a hobby project and I'd like to work on my own.

However I'm now going to release the source so you can use it..
 

Leo-X

New member
Jun 30, 2007
3
0
Development

Hi
I was just wondering, how long will it take for you to make your product compatible to play Mp3 Songs, because I'm tierd of waiting for a Music Player, which is easy to use and fast. And by the way, I think your player is so far the best, it just has to get a litle better UI!!!
 

dosfan

Member
Sep 17, 2007
9
0
Well, here I am with release 002 of my kinetic scroller demo.

I've added alot of optimizations and its silky smooth on my 400Mhz device! It even runs great underclocked at 200Mhz.

Source to follow (once its cleaned up, probably tommorrow)
 

Attachments

  • Scroller-002.zip
    33.4 KB · Views: 879

gingercat

Senior Member
Oct 1, 2006
163
1
Lancaster
Thanks for this! Once again shows how it just takes one person to come up with a great idea (apple (or whoever initially came up with smooth scrolling)) then we all wonder how we lived without it!

I've just been reflecting over it and note that you are relying on .NET garbage collection to clean up e.g. all the graphics and brush objects you create - you need to be careful about this because this isn't deterministic and you can quickly run out of resources before it gets round to cleaning up. I know you say you're going to clean up the code anyway, but just thought I'd add my tip!
 

gingercat

Senior Member
Oct 1, 2006
163
1
Lancaster
The holy grail would be if we can figure out how to hook mouse events, because then mouse movement can be processed independently of the form (and any other items on it). Unfortunately, CE doesn't support this (that I know of). The form approach only works if everything is semi-custom drawn.
 

chrismrulz

Senior Member
Jul 5, 2007
147
0
This new version scrolls as good as or better than iContact, so you can remove that message on the first post.
on the other hand, the version currently implemented in melody v0.6 doesn't seem as good as this one.

btw, once you upload the new source, i'll see if i can make it stop selecting the first touched item when you are trying to scroll.
when thundershadow and i were making our own one we found the way to do this was to do something like listbox1.selectedindex = -1
it should be pretty easy to do.

also, something like this instead of the random number generator could get a list of the files in the current dir:
Code:
            string[] r = System.IO.Directory.GetFiles(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase),".mp3");
            
            klist = new KList(0, 20, screenX, screenY, "All Tracks");
            for (int i = 0; i < r.Length; i++)
            {
                KItem ki = new KItem(i + ". " + r[i] + ".mp3");
                klist.addItem(ki);
            }
dunno if that is accurate or not.. haven't used c# that much.. but it should be easy todo.
 
Last edited:

dosfan

Member
Sep 17, 2007
9
0
Source is now up.

I've starting playing around with MP3 playback but please ignore it (Using the FMODCE .NET wrapper)
 

chrismrulz

Senior Member
Jul 5, 2007
147
0
Source is now up.

I've starting playing around with MP3 playback but please ignore it (Using the FMODCE .NET wrapper)
if you're intending on making it a practical-use app,
probably the best way to go about it is using the shell execute function to open the mp3's in whatever player they associated mp3's to (cos people will want features they prefer than other media players).

and then later on you can add an option to customize the command so the user can use it with a different media player without changing the associations.
so they'd have to make something like: "\SD Card\TCPMP\player.exe /open %mp3path%".
then the app just has to replace "%mp3path%" with the variable for the path to the selected mp3, and launch everything before it to shell.

you'd also need to add something like the code in my last post to get a list of the mp3's (tried it on my ppc and it doesn't work, so it needs to be fixed up though).
 
Last edited:

dosfan

Member
Sep 17, 2007
9
0
if you're intending on making it a practical-use app,
probably the best way to go about it is using the shell execute function to open the mp3's in whatever player they associated mp3's to (cos people will want features they prefer than other media players).

and then later on you can add an option to customize the command so the user can use it with a different media player without changing the associations.
so they'd have to make something like: "\SD Card\TCPMP\player.exe /open %mp3path%".
then the app just has to replace "%mp3path%" with the variable for the path to the selected mp3, and launch everything before it to shell.

you'd also need to add something like the code in my last post to get a list of the mp3's (tried it on my ppc and it doesn't work, so it needs to be fixed up though).

Yes, that something I was already considering.

To be honest, I'm not impressed with FMOD's performance. Even just initalizing the library is causing performance issues (without even playing a MP3, does fmod.init() spawn a thread or something???)

I'm looking for a port of MAD that I could interop with. If anyone knows of a libmad.dll for ARM WINCE point me in the direction!
 

chrismrulz

Senior Member
Jul 5, 2007
147
0
Yes, that something I was already considering.

To be honest, I'm not impressed with FMOD's performance. Even just initalizing the library is causing performance issues (without even playing a MP3, does fmod.init() spawn a thread or something???)

I'm looking for a port of MAD that I could interop with. If anyone knows of a libmad.dll for ARM WINCE point me in the direction!
afaik, performance-wise fmod would be the best library to use.
but the problem is that most people would rather use their own player like tcpmp or wmp that does what they want,
rather than just a basic player with a third-party library in .net cf.
 
Last edited:

gingercat

Senior Member
Oct 1, 2006
163
1
Lancaster
New UserControl version

Hi dosfan,

I have modified the source to create a new KListControl which is a UserControl you can add to any .NET form. All the scroll functionality required is all contained within the new control.

This control doesn't pre-render everything up-front, so should be less memory hungry (especially with long lists) at the slight expense of some speed (runs fine on my hermes).

Each item is now custom drawn, and only needs to support an IKListItem interface - this enables each item to draw whatever it wants, whenever it wants (well, by nicely asking its parent to invalidate it when visible). I have created a basic KListItem object that supports string name, object value (and has the same functionality you provided).

I also updated the project to still compile with the new source, so (if you like the changes) you can continue work from there.

Updates I will still make are:
Better use of statics incase multiple lists are used (currently the background selection image is static)
Common timer between multiple instances of the control (for performance).

Hope you don't mind my changes!

Chris.
 

Attachments

  • Scroller.zip
    772.2 KB · Views: 363

chrismrulz

Senior Member
Jul 5, 2007
147
0
i've just modified gingercat's version to launch the selected mp3 using the windows shell.
to test it out you need to create a directory called "\\SD Card\\My Music", or change the variables in form1 and the klistcontrol to where your music dir is.

if the directory doesn't exist it will browse for mp3 files in the app's directory, then grab the folder of the one selected.
this is not a practical idea, and it won't change the variable in the klistcontrol,
so it wont be able to launch it through shell if you use the browsing method.

a better way would be to make it a folderbrowser dialog instead of a file one,
then make the folder variable in form1 a global variable, and the klistcontrol just grabs it from form1.
that still wouldn't work for subdirectories though.
for that you'd need to tag each klistitem with it's full file path or directory when it's being added.


also it should be pointed out that gingercat's version scrolls a bit too fast.
it's smooth so there aren't any performance issues.
it just goes too far with the tiniest tap up or down.
 

Attachments

  • Scroller.zip
    811.9 KB · Views: 258
Last edited: