[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-multimedia
Subject: Re: StereoVolumeControl with SimpleSoundServer
From: Scott Wheeler <scott () slackorama ! net>
Date: 2002-02-21 5:57:07
[Download RAW message or body]
Ok, thanks! That's been sort of helpful. :-)
I found the example in the now pretty old KDE 2.0 book and managed to get
StereoVolumeControl working for the whole server, but I can't figure out how
to get it to do so with just the PlayObject that I'm working with.
Here's my code:
===
void Player::setVolume(float volume=1.0)
{
// setup volume control
volumeControl = new
StereoVolumeControl(DynamicCast(server->createObject("Arts::StereoVolumeControl")));
if(volumeControl && media && !volumeControl->isNull() && !media->isNull()) {
Synth_BUS_UPLINK uplink = Arts::DynamicCast(media->_getChild( "uplink" ));
uplink.stop();
media->_node()->stop();
// volumeControlId = server->outstack().insertBottom(*volumeControl,
"Volume");
Arts::disconnect(*media, "left", uplink, "left");
Arts::disconnect(*media, "right", uplink, "right");
volumeControl->start();
uplink.start();
media->_node()->start();
media->_addChild(*volumeControl, "volume" );
Arts::connect(*media, "left", *volumeControl, "inleft");
Arts::connect(*media, "right", *volumeControl, "inright");
Arts::connect(*volumeControl, "outleft", uplink, "left");
Arts::connect(*volumeControl, "outright", uplink, "right");
volumeControl->scaleFactor(.1);
kdDebug() << "Scale Factor: " << volumeControl->scaleFactor() << endl;
}
else {
kdDebug() << "!!! Could not initialize volume control!!!" << endl;
}
}
===
This is *very* similar to what is in knotify. It just doesn't do anything.
It claims to be playing the file and then doesn't. If I comment out this
block, everything works fine.
I was able to get things working as:
===
volumeControlId = server->outstack().insertBottom(*volumeControl, "Volume");
===
I just don't know what to do next. Thanks guys!
-Scott
On Wednesday 20 February 2002 06:29 pm, Carsten Pfeiffer wrote:
> On Tue, Feb 19, 2002 at 11:35:31PM -0500, Scott Wheeler wrote:
> > In my application, QTagger, which I'm in the process of porting to KDE 3
> > based on some stuff I got from the list a few months ago, I'm now able to
> > play, pause, stop and seek using SimpleSoundServer. The only other
> > feature that I'd really like to add is the ability to change the volume
> > of a play object.
> >
> > So, what's the easiest/best way to do this? If there's documentation
> > that I'm missing or a good example out there, just point me to that.
> > Unfortunately the Noatun source isn't exactly a nice crash course in aRts
> > programming. :-(
>
> Not sure if it works with SimpleSoundServer as well, but you could have a
> look at kdelibs/arts/knotify/knotify.cpp for volume control.
_______________________________________________
kde-multimedia mailing list
kde-multimedia@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-multimedia
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic