 |
|
 |
Hello, I add this code to have the right pictureSize when the control is resized.
private void AVFader_Resize(object sender, EventArgs e) {
this.picSlider.Width = (int)(this.ClientSize.Width * 0.5F);
this.picSlider.Height = (int) (this.ClientSize.Height*0.25F);
MoveSlider();
}
|
|
|
|
 |
|
 |
Very nice just what i needed nice a simple tool
Kev
|
|
|
|
 |
|
 |
Hello,
I made some fixes in the Sourcecode.
The Position of the Fader was not calculated correctly.
So I modified the MoveFader method like this:
private void MoveSlider()
{
// distance between tics used in ratio calc
int distance = Math.Abs(this._maxValue) + Math.Abs(this._minValue);
// percentage of control travelled
float percent = (float)this._value / (float)distance;
// The minimum position of the Slider Pic
int minPos = this.Height - this.picSlider.Height;
// New slider location
this.picSlider.Top = minPos - Convert.ToInt32(percent * (float)(minPos));
}
Also I'm checking the Event Method like see below:
// Raise the ValueChanged event
if (ValueChanged != null) ValueChanged(this, new EventArgs());
Keep on coding.
Greets, Helmut
greets, Helmut
[http://www.x4u.de]
|
|
|
|
 |
|
 |
I am playing with some audio stuff and just found this control. Although its not 100% what i need the code is written so simply that it has been easy to add the extra properties i need.
Once again, really good work, well done.
Jon
|
|
|
|
 |
|
 |
Hello.
Is it possible to port this control to Pocket PC/windows mobile?
If so, how?
Thanks!
|
|
|
|
 |
|
 |
Hi, can you please help me get this to work?
When I try to place the control onto a winform, I only see the background image with the lines, though not the slider plastic piece. If I look at the control itself, meaning not the control placed into a winForm, just the control itself, I can see the slider piece, without the background lines. Everything compiles fine, it just doesnt work.
I am using Visual Studio 2005 and C#.
Please let me know if you can help. I would love to work with this control, it is awesome!
Thank you,
Mike
|
|
|
|
 |
|
 |
When I wrote this control back in the dark ages, it was under VS2003 and .NET 1.1 Since then I've tried porting a few apps to VS2005/.NET 2.0 without much luck. But this is more lack of time to play with it on my part rather than lack of interest.
If you do manage to get it running, I'm more than happy to put up a .NET 2.0 compatible version if you can show me what mods you've made to the control.
Tim
|
|
|
|
 |
|
 |
Cool everyone! After reading Dermots post before this one, and applying what he suggested, I got the control to work!!!!
;)
I LOVE IT!!!!
Thank you for creating it and sharing it with us!!!!!!!!!!!!!!!!!
Cheers,
Mike
|
|
|
|
 |
|
 |
The slider disappears in my form
Has anyone else had a problem with the picSlider of the control disappearing when u put it into a form? Ive been at it for hours and several other programmers took a look at it and cant figure out y
|
|
|
|
 |
|
 |
Ok i just figured it out. Firstly, make sure you have an event handler method for the ValueChanged event. Either that, or place the event fire it in a try catch in the project (avfader).
Secondly, the slider itself seems to drop way down below the bottom of the control. Just resize the control to see it. After that, u need to position it during the controls startup so its visible within the confines of the control.
As usual, its the incrediblly simple things that hold me up!
|
|
|
|
 |
|
 |
Hi
I downloaded this source code and trying to execute AVFaderTest application by giving reference of AVFader.dll,but it gives error AVFader namespace could not found.
Why it gives like that?
Please give me any solution to this problem,i want to execute this application.If you know the solution please send me mail to this id mail2mamathak@yahoo.com
Thanks in advance.
Mamatha
|
|
|
|
 |
|
 |
I'm new at C# so this is probaly a stupid question but... How do I use this.
If I open the sample app the slider is not there and will not compile. I tried making a solution with both the slider and the sample app in it but still no go.
|
|
|
|
 |
|
|
 |
|
 |
You stated that you were creating this for Audio and Video projects you were working on. If you could share some of the Audio code you've been working on, that would be great. I've been trying to build a MP3 player with crossfade and Audio level indicator (the part I'm really interested in ) as the music plays.
Thanks
The Q
asdf
|
|
|
|
 |
|
 |
The audio project you are referring to is a dsktop jukebox, I guess similar to Winamp, but a lot simpler. While I haven't started work on that project yet, I will try and remember to post something on the topic when I do start it as I dont think I've seen that functionality around either.
The audio level indicator shouldn't be too hard if you are using DirectSound to handle the audio, the crossfade might be an issue, not sure yet. I'll see what I find when I start work on it.
*sigh* so many projects, so little time.
Tim
|
|
|
|
 |
|
 |
Hi,
I hate to say that but your control is not quite it (yet). Being an audio engineer myself, I am taking the right to comment your control
First of all, it is a linear or logarithmic slider? Also, a real fader doesn't have as many position lines as yours, but will display things like 0db (or U for unity gain), +3db, +6db, -6db, -12db, -18db... to -infinite instead.
Without those labels, a fader is a lot harder to use. And since you're at it, you should also trigger an event called PositionChangedEvent every time the slider moves. This event should return the exact decibel value. (Maybe you have already implemented the event, didn't check)
Keep up the good work!
Carl
|
|
|
|
 |
|
 |
Carl,
I appreciate your comments on the control, but if you check the article text (particularly the section on design constraints), I think you will find the answers to your questions.
1. Its a linear slider for design simplicity reasons
The fader control was never intended on my part to be used for returning dB levels, just whatever numerical constraints you set in the properties. I probably mislabelled the title of the article as I am actually using it for a lighting console application, where the sliders are linear and dont have the numerical readings next to the tics.
On the topic of number of tics, you can adjust this with the TickFrequency property. And you will find that as per the code snippet above, the ValueChanged event is raised when the slider is moved.
It sounds as though you are basing your questions on what you see above in the picture without actually running the project yourself. As per the design constraints, I wanted it to work very similar to the TrackBar control, hence the use of Minimum, Maximum, TickFrequency and ValueChanged in the control to keep it inline with the TrackBar.
I appreciate the comments on the values though and will take them into consideration.
|
|
|
|
 |
|
 |
Hi,
You are right, I didn't take a look at the code... I just wrote some comments on how it could be improved for an audio slider because an audio slider is usually logarithmic.
In version 2.0, you could have a property to switch it from linear to log, and another property to display DB values
Take it easy!
Carl
|
|
|
|
 |
|
 |
The biggest issue I have in trying to implement the log scale is that null and voids the TickFrequency property as the frequency is then fixed using that scale. I almost need to create two sliders, one linear, one log. Even though the movement is similar, the calcs and display are just different enough to cause some problems.
Any suggestions on solving the TickFrequency issue?
|
|
|
|
 |
|
 |
Your search was not good enough. Try this controls ...
http://www.9rays.net/cgi-bin/components.cgi?act=1&cid=90
elli
|
|
|
|
 |
|
|
 |
|
 |
Cost was never an issue. I wanted to learn how to make custom controls in .NET and this was a project which didn't exist on Code Project yet, so I took it up as a challenge.
|
|
|
|
 |
|
|
 |
|
 |
I looked as 9rays controls, but the screenshots don't show a control as reaslistic looking as this one. I think this is a very reaslistic looking control.
9ray don't provide source for the control so we can learn from it. Before you slate the control, remember the reason people put their work on here, for the community to review and learn from the code, not to buy it or evaluate it as a product.
Don't worry, nobody lives forever.
|
|
|
|
 |
|
 |
Code Project is all about learning and I dont profess to know everything about development, hence the creation of this article. I want to learn from what others can tell me about making this control better.
Thank you for your comments Bernhard. Especially for taking the spirit of the project and this site into consideration.
|
|
|
|
 |