Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > VLC Mod: Progress bars

VLC Mod: Progress bars
Thread Tools
Synotic
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Feb 20, 2003, 12:08 AM
 
OK, here's the deal. VideoLAN recently released VLC version 0.5. This introduced a new custom interface which is less than perfect. I've created a revised interface which I want to implement, but it utilizes a custom progress bar like that of iTunes which I do not know how to code.

This is where you come in, there has been lots of interest in getting this interface working (both on and off the forums). VLC just happens to be open source, and if anyone is willing to take some time to see if this can be implemented (mainly the custom progress bar but I also show the title of the currently played movie) then a lot of people would really appreciate it... Thanks

     
int69h
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Feb 23, 2003, 11:12 AM
 
The contents of the view would be trivial to implement. It could be done with one stroked bezier path, two filled bezier paths, and one call to NSString. Drawing that fancy sunken border around it looks to be the hardest part. If no one has picked up on it by the time I finish my current project, I'll look into it.
     
Synotic  (op)
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Feb 23, 2003, 02:53 PM
 
Originally posted by int69h:
The contents of the view would be trivial to implement. It could be done with one stroked bezier path, two filled bezier paths, and one call to NSString. Drawing that fancy sunken border around it looks to be the hardest part. If no one has picked up on it by the time I finish my current project, I'll look into it.
Does it have to be drawn? You could just use some images... Also I need to take a poll on how people feel about my lack of the fast-forward/rewind buttons. I haven't had a single comment about them, so I dunno. I personally hate them, I never even liked DVD rewind/fast forward. It may be psychological I dunno but with VLC I'd just use the progress bar. We'll see...

edit: thanks
     
int69h
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Feb 23, 2003, 06:13 PM
 
I was over-engineering. It would just need a subclass of NSSlider. Everything else could be done through IB.
     
int69h
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Feb 23, 2003, 06:15 PM
 
You don't really need fast forward and rewind buttons. Your progress indicator could handle that function like it does in iTunes.
     
int69h
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Feb 24, 2003, 12:24 PM
 
It's getting there. Most of my time was spent in vain trying to figure out why my custom NSSliderCell wasn't working. Come to find out it was working fine. Stupid Interface Builder was assigning the default NSSliderCell to my NSSlider subclass and then archiving the object that way. I had to go with a "Custom View" to get it to do the right thing.

I won't have time to work on it for awhile. Any idea when the next revision of VLC is due?

Mac OS X


GNUstep on Gentoo x86 (Renaissance XML "nibs" are awesome)


Do you prefer the thumb like that or would you like me to rotate it by 45 degrees like your mockup?

The GNUstep version looks nicer because OSX has some weird algorithm for determining the Thumb rect size. At 20 pixel height, it sends me a rect that is close to square, but at say 15 pixels it sends me a rect that is twice as wide as it is tall. I'm going to ignore the rect it passes me and draw it right, but then I'll have to change the hit detection code for the Thumb.

edit:
OS X shot is also in 16-bit color which adds to its poor appearance.
( Last edited by int69h; Feb 24, 2003 at 12:57 PM. )
     
Synotic  (op)
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Feb 24, 2003, 04:13 PM
 
Originally posted by int69h:
It's getting there. Most of my time was spent in vain trying to figure out why my custom NSSliderCell wasn't working. Come to find out it was working fine. Stupid Interface Builder was assigning the default NSSliderCell to my NSSlider subclass and then archiving the object that way. I had to go with a "Custom View" to get it to do the right thing.

I won't have time to work on it for awhile. Any idea when the next revision of VLC is due?

Mac OS X


GNUstep on Gentoo x86 (Renaissance XML "nibs" are awesome)


Do you prefer the thumb like that or would you like me to rotate it by 45 degrees like your mockup?

The GNUstep version looks nicer because OSX has some weird algorithm for determining the Thumb rect size. At 20 pixel height, it sends me a rect that is close to square, but at say 15 pixels it sends me a rect that is twice as wide as it is tall. I'm going to ignore the rect it passes me and draw it right, but then I'll have to change the hit detection code for the Thumb.

edit:
OS X shot is also in 16-bit color which adds to its poor appearance.
Looks cool, but yeah... I'd like it to look what it looks like Do you think using bitmaps would result in a more reliable looking slider rather than attempting to redraw it?
     
int69h
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Feb 24, 2003, 07:35 PM
 
Do you want it to act like a slider? If you click somewhere in the trough, do you want to be notified of the position you should jump the video to (like iTunes)? If this is a requirement, blitting bitmaps instead of filling rects isn't going to change much, because we'll still need to subclass NSSliderCell.

If all you need is a visual update that the user can't interact with, blitting bitmaps still doesn't really provide any advantage over filling rects, but the faux slider would be alot easier to implement.

I think the first method is a more reusable piece of code, and is probably the route I'm going to take. I'm working on a mixer framework for OSS, ALSA, CoreAudio, and Windows, and I think those sliders would look pretty nifty as mixer controls for *drumroll* Mixer.app.

Anyone got any idea why OS X uses proportional thumbs/knobs for NSSlider? I can understand the benefits of it for NSScroller. Apple's NSSlider knobs don't scale do they?

They deprecated setKnobThickness:, the obvious way to achieve my goal.
     
int69h
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Feb 24, 2003, 08:07 PM
 
Oops. The knob isn't proportional. I bet it only scales in one direction. That's the source of my trouble I'm sure. I really need to stop stabbing in the dark and RTFM. Feel free to ridicule me.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 2, 2003, 06:22 AM
 
Well, I have some good news and some bad news.

The good news: I've got an iTunes clone slider up and running. It has basically all the functionality of a tickless NSSlider and its appearance is a near-exact replica of iTunes' slider. The main differences are that it lacks the ability to go vertical like an NSSlider (and that I could add if you really need it), and it uses standard Quartz antialiasing rather than iTunes' strange custom algorithm. What I did was subclass NSControl and reverse-engineer NSSlider from there. Currently there's one kink with dragging the thumb, but that shouldn't take long to fix.

The bad news: I hope you know how to compile VLC, because you can't just put custom widgets into a nib and expect the program to know how to draw them. The class has to be compiled or loaded in.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Synotic  (op)
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Mar 2, 2003, 12:38 PM
 
Originally posted by Chuckit:
Well, I have some good news and some bad news.

The good news: I've got an iTunes clone slider up and running. It has basically all the functionality of a tickless NSSlider and its appearance is a near-exact replica of iTunes' slider. The main differences are that it lacks the ability to go vertical like an NSSlider (and that I could add if you really need it), and it uses standard Quartz antialiasing rather than iTunes' strange custom algorithm. What I did was subclass NSControl and reverse-engineer NSSlider from there. Currently there's one kink with dragging the thumb, but that shouldn't take long to fix.

The bad news: I hope you know how to compile VLC, because you can't just put custom widgets into a nib and expect the program to know how to draw them. The class has to be compiled or loaded in.
OK I really should have kept up with this... Sorry int Anyways, yes it should be like a slider.

Now Chuckit, it looks like you've got it a bit closer, I am glad to hear that the functionality is working Vertical wouldn't be needed for now so that should be ok. Now I know I am being a real prick but I really think the look of it is the pixel pushing type thing. The lac of anti-aliasing works for it because it's meant to be precise. Also, would the shadow be hard? I know there's a drop shadow class out there. Otherwise, keep up the good work
     
int69h
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Mar 3, 2003, 07:23 PM
 
Originally posted by Chuckit:
Well, I have some good news and some bad news.
Yours looks very nice. Mind if I ask why you reimplemented NSSlider instead of make a subclass of NSSliderCell?

I haven't got a chance to make any progress. I'll put what I do have complete on the web this evening. Maybe it could be of some use, but it's pretty weak. Mostly just a "hello world" to figure out how NSSliderCell works. It does do vertical though
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 3, 2003, 08:33 PM
 
Originally posted by int69h:
Mind if I ask why you reimplemented NSSlider instead of make a subclass of NSSliderCell?
Well, I did try making a subclass of NSSliderCell at first, but basically I found myself having to fight NSSliderCell to get it to do what I want. The slider functionality was really easy to implement (and the API is tiny), so I just decided I'd rather reinvent the wheel than try to put a square wheel on a round axel, if you catch my mixed metaphor.

By the way, the drop shadow shouldn't be too hard (I'll do it once I get home tonight), but getting the slider to look right when not antialiased is kind of interesting. Quartz wants to draw all the pixels it normally would, but it just draws them all pain black. So the slider winds up looking all fat and monstrous.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 03:43 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,