mirror of
https://review.haiku-os.org/haiku
synced 2025-01-24 07:14:48 +01:00
0a483e7221
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@86 a95241bf-73f2-0310-859d-f6bbb57e9c96
59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
/***********************************************************************
|
|
* AUTHOR: Marcus Overhagen
|
|
* FILE: VolumeControl.cpp
|
|
* DESCR: transitional private volume control functions
|
|
***********************************************************************/
|
|
|
|
#include <Message.h>
|
|
#include <Messenger.h>
|
|
#include "debug.h"
|
|
#include "VolumeControl.h"
|
|
#include "ServerInterface.h"
|
|
|
|
namespace MediaKitPrivate {
|
|
|
|
status_t GetMasterVolume(float *left, float *right)
|
|
{
|
|
CALLED();
|
|
BMessenger m(NEW_MEDIA_SERVER_SIGNATURE);
|
|
BMessage msg(MEDIA_SERVER_GET_VOLUME);
|
|
BMessage reply;
|
|
status_t s;
|
|
|
|
if (!m.IsValid())
|
|
return B_ERROR;
|
|
|
|
s = m.SendMessage(&msg,&reply);
|
|
if (s != B_OK)
|
|
return s;
|
|
|
|
reply.FindFloat("left",left);
|
|
reply.FindFloat("right",right);
|
|
|
|
return (status_t)reply.what;
|
|
}
|
|
|
|
status_t SetMasterVolume(float left, float right)
|
|
{
|
|
CALLED();
|
|
BMessenger m(NEW_MEDIA_SERVER_SIGNATURE);
|
|
BMessage msg(MEDIA_SERVER_SET_VOLUME);
|
|
BMessage reply;
|
|
status_t s;
|
|
|
|
if (!m.IsValid())
|
|
return B_ERROR;
|
|
|
|
msg.AddFloat("left",left);
|
|
msg.AddFloat("right",right);
|
|
|
|
s = m.SendMessage(&msg,&reply);
|
|
if (s != B_OK)
|
|
return s;
|
|
|
|
return (status_t)reply.what;
|
|
}
|
|
|
|
} //namespace MediaKitPrivate
|
|
|