* Removed a superfluous SetMouseEventMask() in the Slider constructor (at least

it was good enough to fix SetMouseEventMask() to no longer drop into the debugger).
* Minor cleanup, renamed member variables to comply with our style guide.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15832 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-01-03 23:28:23 +00:00
parent a6dd420a2b
commit ab364a18e9
2 changed files with 173 additions and 170 deletions
+132 -125
View File
@@ -1,19 +1,12 @@
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ /*
// * Copyright (c) 2003-2005, Haiku, Inc.
// Copyright (c) 2003, OpenBeOS * Distributed under the terms of the MIT license.
// *
// This software is part of the OpenBeOS distribution and is covered * Authors:
// by the OpenBeOS license. * Jérôme Duval
// * François Revol
// */
// Program: desklink
// Author: Jérôme DUVAL
// Description: VolumeControl and link items in Deskbar
// Created : October 20, 2003
// Modified by: Jérome Duval
// Modified by: François Revol, 10/31/2003
//
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
#include <MediaRoster.h> #include <MediaRoster.h>
#include <MediaTheme.h> #include <MediaTheme.h>
@@ -30,15 +23,19 @@
#define VOLUME_CHANGED 'vlcg' #define VOLUME_CHANGED 'vlcg'
#define VOLUME_UPDATED 'vlud' #define VOLUME_UPDATED 'vlud'
#define REDZONESTART 151
VolumeSlider::VolumeSlider(BRect frame, bool dontBeep, int32 volumeWhich) VolumeSlider::VolumeSlider(BRect frame, bool dontBeep, int32 volumeWhich)
: BWindow(frame, "VolumeSlider", B_BORDERED_WINDOW_LOOK, B_FLOATING_ALL_WINDOW_FEEL, B_ASYNCHRONOUS_CONTROLS | B_WILL_ACCEPT_FIRST_CLICK, 0), : BWindow(frame, "VolumeSlider", B_BORDERED_WINDOW_LOOK, B_FLOATING_ALL_WINDOW_FEEL,
aOutNode(NULL), B_ASYNCHRONOUS_CONTROLS | B_WILL_ACCEPT_FIRST_CLICK, 0),
paramWeb(NULL), fAudioMixerNode(NULL),
mixerParam(NULL) fParamWeb(NULL),
fMixerParam(NULL)
{ {
//Make sure it's not outside the screen. // Make sure it's not outside the screen.
const int32 kMargin = 3; const int32 kMargin = 3;
BRect windowRect=ConvertToScreen(Bounds()); BRect windowRect = ConvertToScreen(Bounds());
BRect screenFrame(BScreen(B_MAIN_SCREEN_ID).Frame()); BRect screenFrame(BScreen(B_MAIN_SCREEN_ID).Frame());
if (screenFrame.right < windowRect.right + kMargin) if (screenFrame.right < windowRect.right + kMargin)
MoveBy(- kMargin - windowRect.right + screenFrame.right, 0); MoveBy(- kMargin - windowRect.right + screenFrame.right, 0);
@@ -51,9 +48,9 @@ VolumeSlider::VolumeSlider(BRect frame, bool dontBeep, int32 volumeWhich)
float value = 0.0; float value = 0.0;
bool retrying = false; bool retrying = false;
this->dontBeep = dontBeep; fDontBeep = dontBeep;
aOutNode = new media_node(); fAudioMixerNode = new media_node();
status_t err = B_OK; /* BMediaRoster::Roster() doesn't set it if all is ok */ status_t err = B_OK; /* BMediaRoster::Roster() doesn't set it if all is ok */
const char *errString = NULL; const char *errString = NULL;
@@ -76,24 +73,23 @@ VolumeSlider::VolumeSlider(BRect frame, bool dontBeep, int32 volumeWhich)
roster = BMediaRoster::Roster(&err); roster = BMediaRoster::Roster(&err);
} }
if (roster && (err==B_OK)) { if (roster && err == B_OK) {
switch (volumeWhich) { switch (volumeWhich) {
case VOLUME_USE_MIXER: case VOLUME_USE_MIXER:
err = roster->GetAudioMixer(aOutNode); err = roster->GetAudioMixer(fAudioMixerNode);
break; break;
case VOLUME_USE_PHYS_OUTPUT: case VOLUME_USE_PHYS_OUTPUT:
err = roster->GetAudioOutput(aOutNode); err = roster->GetAudioOutput(fAudioMixerNode);
break; break;
} }
if(err == B_OK) { if (err == B_OK) {
if((err = roster->GetParameterWebFor(*aOutNode, &paramWeb)) == B_OK) { if ((err = roster->GetParameterWebFor(*fAudioMixerNode, &fParamWeb)) == B_OK) {
// Finding the Mixer slider in the audio output ParameterWeb
//Finding the Mixer slider in the audio output ParameterWeb int32 numParams = fParamWeb->CountParameters();
int32 numParams = paramWeb->CountParameters();
BParameter* p = NULL; BParameter* p = NULL;
bool foundMixerLabel = false; bool foundMixerLabel = false;
for (int i = 0; i < numParams; i++) { for (int i = 0; i < numParams; i++) {
p = paramWeb->ParameterAt(i); p = fParamWeb->ParameterAt(i);
PRINT(("BParameter[%i]: %s\n", i, p->Name())); PRINT(("BParameter[%i]: %s\n", i, p->Name()));
if (volumeWhich == VOLUME_USE_MIXER) { if (volumeWhich == VOLUME_USE_MIXER) {
if (!strcmp(p->Kind(), B_MASTER_GAIN)) if (!strcmp(p->Kind(), B_MASTER_GAIN))
@@ -105,13 +101,13 @@ VolumeSlider::VolumeSlider(BRect frame, bool dontBeep, int32 volumeWhich)
if (!strcmp(p->Kind(), B_MASTER_GAIN)) if (!strcmp(p->Kind(), B_MASTER_GAIN))
break; break;
PRINT(("not MASTER_GAIN \n")); PRINT(("not MASTER_GAIN \n"));
/* some audio card /* some audio card
*/ */
if (!strcmp(p->Name(), "Master")) if (!strcmp(p->Name(), "Master"))
break; break;
PRINT(("not 'Master' \n")); PRINT(("not 'Master' \n"));
/* some Ensonic card have all controls names 'Volume', so /* some Ensonic card have all controls names 'Volume', so
* need to fint the one that has the 'Mixer' text label * need to fint the one that has the 'Mixer' text label
*/ */
@@ -125,7 +121,7 @@ VolumeSlider::VolumeSlider(BRect frame, bool dontBeep, int32 volumeWhich)
//if (!strcmp(p->Name(), "Master")) { //if (!strcmp(p->Name(), "Master")) {
if (!strcmp(p->Kind(), B_MASTER_GAIN)) { if (!strcmp(p->Kind(), B_MASTER_GAIN)) {
for (; i < numParams; i++) { for (; i < numParams; i++) {
p = paramWeb->ParameterAt(i); p = fParamWeb->ParameterAt(i);
if (strcmp(p->Kind(), B_MASTER_GAIN)) p=NULL; if (strcmp(p->Kind(), B_MASTER_GAIN)) p=NULL;
else break; else break;
} }
@@ -134,24 +130,25 @@ VolumeSlider::VolumeSlider(BRect frame, bool dontBeep, int32 volumeWhich)
#endif #endif
p = NULL; p = NULL;
} }
if (p==NULL) { if (p == NULL) {
errString = volumeWhich?"Could not find the soundcard":"Could not find the mixer"; errString = volumeWhich
} else if(p->Type()!=BParameter::B_CONTINUOUS_PARAMETER) { ? "Could not find the soundcard":"Could not find the mixer";
errString = volumeWhich?"Soundcard control unknown":"Mixer control unknown"; } else if (p->Type() != BParameter::B_CONTINUOUS_PARAMETER) {
errString = volumeWhich
? "Soundcard control unknown":"Mixer control unknown";
} else { } else {
fMixerParam = dynamic_cast<BContinuousParameter*>(p);
mixerParam = dynamic_cast<BContinuousParameter*>(p); fMin = fMixerParam->MinValue();
min = mixerParam->MinValue(); fMax = fMixerParam->MaxValue();
max = mixerParam->MaxValue(); fStep = fMixerParam->ValueStep();
step = mixerParam->ValueStep();
float chanData[2]; float chanData[2];
bigtime_t lastChange; bigtime_t lastChange;
size_t size = sizeof(chanData); size_t size = sizeof(chanData);
mixerParam->GetValue( &chanData, &size, &lastChange ); fMixerParam->GetValue(&chanData, &size, &lastChange);
value = (chanData[0]-min)*100/((max-min)?(max-min):1); value = (chanData[0] - fMin) * 100 / ((fMax - fMin) ? (fMax - fMin) : 1);
} }
} else { } else {
errString = "No parameter web"; errString = "No parameter web";
@@ -161,7 +158,7 @@ VolumeSlider::VolumeSlider(BRect frame, bool dontBeep, int32 volumeWhich)
retrying = true; retrying = true;
goto retry; goto retry;
} }
errString = volumeWhich?"No Audio output":"No Mixer"; errString = volumeWhich ? "No Audio output" : "No Mixer";
} }
} else { } else {
if (!retrying) { if (!retrying) {
@@ -170,36 +167,37 @@ VolumeSlider::VolumeSlider(BRect frame, bool dontBeep, int32 volumeWhich)
} }
errString = "No Media Roster"; errString = "No Media Roster";
} }
if(err!=B_OK) { if (err != B_OK) {
delete aOutNode; delete fAudioMixerNode;
aOutNode = NULL; fAudioMixerNode = NULL;
} }
if (errString) if (errString)
fprintf(stderr, "VolumeSlider: %s.\n", errString); fprintf(stderr, "VolumeSlider: %s.\n", errString);
BBox *box = new BBox(Bounds(), "sliderbox", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_FRAME_EVENTS, B_PLAIN_BORDER); BBox *box = new BBox(Bounds(), "sliderbox", B_FOLLOW_LEFT | B_FOLLOW_TOP,
B_WILL_DRAW | B_FRAME_EVENTS, B_PLAIN_BORDER);
AddChild(box); AddChild(box);
hasChanged = false; /* make sure we don't beep if we don't change anything */ fHasChanged = false; /* make sure we don't beep if we don't change anything */
if (mixerParam == NULL) if (fMixerParam == NULL)
value = -1; value = -1;
slider = new SliderView(box->Bounds().InsetByCopy(1, 1), new BMessage(VOLUME_CHANGED), fSlider = new SliderView(box->Bounds().InsetByCopy(1, 1), new BMessage(VOLUME_CHANGED),
(errString==NULL) ? "Volume" : errString, B_FOLLOW_LEFT | B_FOLLOW_TOP, value); errString == NULL ? "Volume" : errString, B_FOLLOW_LEFT | B_FOLLOW_TOP, value);
box->AddChild(slider); box->AddChild(fSlider);
slider->SetTarget(this); fSlider->SetTarget(this);
SetPulseRate(100); SetPulseRate(100);
} }
VolumeSlider::~VolumeSlider() VolumeSlider::~VolumeSlider()
{ {
delete paramWeb; delete fParamWeb;
BMediaRoster* roster = BMediaRoster::CurrentRoster(); BMediaRoster* roster = BMediaRoster::CurrentRoster();
if(roster && aOutNode) if (roster && fAudioMixerNode)
roster->ReleaseNode(*aOutNode); roster->ReleaseNode(*fAudioMixerNode);
} }
@@ -209,70 +207,77 @@ VolumeSlider::WindowActivated(bool active)
/* don't Quit() ! thanks for FFM users */ /* don't Quit() ! thanks for FFM users */
} }
void
void
VolumeSlider::MessageReceived(BMessage *msg) VolumeSlider::MessageReceived(BMessage *msg)
{ {
switch (msg->what) { switch (msg->what) {
case VOLUME_UPDATED: case VOLUME_UPDATED:
PRINT(("VOLUME_UPDATED\n")); PRINT(("VOLUME_UPDATED\n"));
UpdateVolume(mixerParam); UpdateVolume(fMixerParam);
hasChanged = true; fHasChanged = true;
break; break;
case VOLUME_CHANGED:
if (hasChanged) { case VOLUME_CHANGED:
PRINT(("VOLUME_CHANGED\n")); if (fHasChanged) {
UpdateVolume(mixerParam); PRINT(("VOLUME_CHANGED\n"));
if (!dontBeep) UpdateVolume(fMixerParam);
beep(); if (!fDontBeep)
} beep();
Quit(); }
break; Quit();
default: break;
BWindow::MessageReceived(msg); // not a slider message, not our problem
default:
BWindow::MessageReceived(msg); // not a slider message, not our problem
} }
} }
void VolumeSlider::UpdateVolume(BContinuousParameter* param)
void
VolumeSlider::UpdateVolume(BContinuousParameter* param)
{ {
if (!param) if (!param)
return; return;
float chanData[2]; float chanData[2];
bigtime_t lastChange; bigtime_t lastChange;
size_t size = sizeof(chanData); size_t size = sizeof(chanData);
mixerParam->GetValue( &chanData, &size, &lastChange ); fMixerParam->GetValue( &chanData, &size, &lastChange );
for( int i=0; i<2; i++) { for (int i = 0; i < 2; i++) {
chanData[i] = (slider->Value() * (max - min) / 100) / step * step + min; chanData[i] = (fSlider->Value() * (fMax - fMin) / 100) / fStep * fStep + fMin;
} }
PRINT(("Min value: %f Max Value: %f\nData: %f %f\n", mixerParam->MinValue(), mixerParam->MaxValue(), chanData[0], chanData[1])); PRINT(("Min value: %f Max Value: %f\nData: %f %f\n",
mixerParam->SetValue(&chanData, sizeof(chanData), system_time()+1000); fMixerParam->MinValue(), fMixerParam->MaxValue(), chanData[0], chanData[1]));
fMixerParam->SetValue(&chanData, sizeof(chanData), system_time()+1000);
} }
#define REDZONESTART 151
// #pragma mark -
SliderView::SliderView(BRect rect, BMessage *msg, const char *title, uint32 resizeFlags, int32 value) SliderView::SliderView(BRect rect, BMessage *msg, const char *title,
uint32 resizeFlags, int32 value)
: BControl(rect, "slider", NULL, msg, resizeFlags, B_WILL_DRAW | B_PULSE_NEEDED), : BControl(rect, "slider", NULL, msg, resizeFlags, B_WILL_DRAW | B_PULSE_NEEDED),
leftBitmap(BRect(0, 0, kLeftWidth - 1, kLeftHeight - 1), B_CMAP8), fLeftBitmap(BRect(0, 0, kLeftWidth - 1, kLeftHeight - 1), B_CMAP8),
rightBitmap(BRect(0, 0, kRightWidth - 1, kRightHeight - 1), B_CMAP8), fRightBitmap(BRect(0, 0, kRightWidth - 1, kRightHeight - 1), B_CMAP8),
buttonBitmap(BRect(0, 0, kButtonWidth - 1, kButtonHeight - 1), B_CMAP8), fButtonBitmap(BRect(0, 0, kButtonWidth - 1, kButtonHeight - 1), B_CMAP8),
fTitle(title) fTitle(title)
{ {
leftBitmap.SetBits(kLeftBits, kLeftWidth * kLeftHeight, 0, B_CMAP8); fLeftBitmap.SetBits(kLeftBits, kLeftWidth * kLeftHeight, 0, B_CMAP8);
rightBitmap.SetBits(kRightBits, kRightWidth * kRightHeight, 0, B_CMAP8); fRightBitmap.SetBits(kRightBits, kRightWidth * kRightHeight, 0, B_CMAP8);
buttonBitmap.SetBits(kButtonBits, kButtonWidth * kButtonHeight, 0, B_CMAP8); fButtonBitmap.SetBits(kButtonBits, kButtonWidth * kButtonHeight, 0, B_CMAP8);
SetTracking(true); SetTracking(true);
SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS);
SetValue(value); SetValue(value);
} }
SliderView::~SliderView() SliderView::~SliderView()
{ {
} }
@@ -283,7 +288,7 @@ SliderView::Pulse()
BPoint where; BPoint where;
GetMouse(&where, &mouseButtons, true); GetMouse(&where, &mouseButtons, true);
// button not pressed, exit // button not pressed, exit
if (! (mouseButtons & B_PRIMARY_MOUSE_BUTTON)) { if (!(mouseButtons & B_PRIMARY_MOUSE_BUTTON)) {
SetTracking(false); SetTracking(false);
Invoke(); Invoke();
} }
@@ -301,21 +306,21 @@ SliderView::Draw(BRect updateRect)
StrokeLine(BPoint(11,14), BPoint(192,14)); StrokeLine(BPoint(11,14), BPoint(192,14));
SetHighColor(231,227,231); SetHighColor(231,227,231);
StrokeLine(BPoint(11,15), BPoint(192,15)); StrokeLine(BPoint(11,15), BPoint(192,15));
SetLowColor(ViewColor()); SetLowColor(ViewColor());
SetDrawingMode(B_OP_OVER); SetDrawingMode(B_OP_OVER);
DrawBitmapAsync(&leftBitmap, BPoint(5,1)); DrawBitmapAsync(&fLeftBitmap, BPoint(5,1));
DrawBitmapAsync(&rightBitmap, BPoint(193,1)); DrawBitmapAsync(&fRightBitmap, BPoint(193,1));
float position = 11 + (192-11) * ((Value()==-1)?0:Value()) / 100; float position = 11 + (192-11) * ((Value() == -1) ? 0 : Value()) / 100;
float right = (position < REDZONESTART) ? position : REDZONESTART; float right = (position < REDZONESTART) ? position : REDZONESTART;
SetHighColor(99,151,99); SetHighColor(99,151,99);
FillRect(BRect(11,3,right,4)); FillRect(BRect(11,3,right,4));
SetHighColor(156,203,156); SetHighColor(156,203,156);
FillRect(BRect(11,5,right,13)); FillRect(BRect(11,5,right,13));
if(right == REDZONESTART) { if (right == REDZONESTART) {
SetHighColor(156,101,99); SetHighColor(156,101,99);
FillRect(BRect(REDZONESTART,3,position,4)); FillRect(BRect(REDZONESTART,3,position,4));
SetHighColor(255,154,156); SetHighColor(255,154,156);
@@ -323,17 +328,17 @@ SliderView::Draw(BRect updateRect)
} }
SetHighColor(156,154,156); SetHighColor(156,154,156);
FillRect(BRect(position,3,192,13)); FillRect(BRect(position,3,192,13));
BFont font; BFont font;
float width = font.StringWidth(fTitle); float width = font.StringWidth(fTitle);
SetHighColor(49,154,49); SetHighColor(49,154,49);
DrawString(fTitle, BPoint(11 + (192-11-width)/2, 12)); DrawString(fTitle, BPoint(11 + (192-11-width)/2, 12));
DrawBitmapAsync(&buttonBitmap, BPoint(position-5,3)); DrawBitmapAsync(&fButtonBitmap, BPoint(position-5,3));
Sync(); Sync();
SetDrawingMode(B_OP_COPY); SetDrawingMode(B_OP_COPY);
} }
@@ -343,18 +348,18 @@ SliderView::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
{ {
if (!IsTracking()) if (!IsTracking())
return; return;
uint32 mouseButtons; uint32 mouseButtons;
BPoint where; BPoint where;
GetMouse(&where, &mouseButtons, true); GetMouse(&where, &mouseButtons, true);
// button not pressed, exit // button not pressed, exit
if (! (mouseButtons & B_PRIMARY_MOUSE_BUTTON)) { if (! (mouseButtons & B_PRIMARY_MOUSE_BUTTON)) {
Invoke(); Invoke();
SetTracking(false); SetTracking(false);
} }
if ((Value() == -1) || !Bounds().InsetBySelf(2,2).Contains(point)) if (Value() == -1 || !Bounds().InsetBySelf(2, 2).Contains(point))
return; return;
float v = MIN(MAX(point.x, 11), 192); float v = MIN(MAX(point.x, 11), 192);
@@ -363,6 +368,7 @@ SliderView::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
SetValue(v); SetValue(v);
Draw(Bounds()); Draw(Bounds());
Flush(); Flush();
if (Window()) if (Window())
Window()->PostMessage(VOLUME_UPDATED); Window()->PostMessage(VOLUME_UPDATED);
} }
@@ -373,13 +379,14 @@ SliderView::MouseUp(BPoint point)
{ {
if (!IsTracking()) if (!IsTracking())
return; return;
if ((Value() != -1) && Bounds().InsetBySelf(2,2).Contains(point)) {
if (Value() != -1 && Bounds().InsetBySelf(2, 2).Contains(point)) {
float v = MIN(MAX(point.x, 11), 192); float v = MIN(MAX(point.x, 11), 192);
v = (v - 11) / (192-11) * 100; v = (v - 11) / (192-11) * 100;
v = MAX(MIN(v,100), 0); v = MAX(MIN(v,100), 0);
SetValue(v); SetValue(v);
} }
Invoke(); Invoke();
SetTracking(false); SetTracking(false);
Draw(Bounds()); Draw(Bounds());
+41 -45
View File
@@ -1,19 +1,11 @@
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ /*
// * Copyright (c) 2003-2005, Haiku, Inc.
// Copyright (c) 2003, OpenBeOS * Distributed under the terms of the MIT license.
// *
// This software is part of the OpenBeOS distribution and is covered * Authors:
// by the OpenBeOS license. * Jérôme Duval
// * François Revol
// */
// Program: desklink
// Author: Jérôme DUVAL
// Description: VolumeControl and link items in Deskbar
// Created : October 20, 2003
// Modified by: Jérome Duval
// Modified by: François Revol, 10/31/2003
//
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
#ifndef VOLUMESLIDER_H #ifndef VOLUMESLIDER_H
#define VOLUMESLIDER_H #define VOLUMESLIDER_H
@@ -25,37 +17,41 @@
#define VOLUME_USE_MIXER 0 /* default */ #define VOLUME_USE_MIXER 0 /* default */
#define VOLUME_USE_PHYS_OUTPUT 1 #define VOLUME_USE_PHYS_OUTPUT 1
class SliderView : public BControl
{ class SliderView : public BControl {
public: public:
SliderView(BRect rect, BMessage *msg, const char* title, uint32 resizeFlags, int32 value); SliderView(BRect rect, BMessage *msg, const char* title, uint32 resizeFlags,
~SliderView(); int32 value);
virtual void Draw(BRect); ~SliderView();
virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
virtual void MouseUp(BPoint point); virtual void Draw(BRect);
virtual void Pulse(); virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
private: virtual void MouseUp(BPoint point);
BBitmap leftBitmap, rightBitmap, buttonBitmap; virtual void Pulse();
const char* fTitle;
private:
BBitmap fLeftBitmap, fRightBitmap, fButtonBitmap;
const char* fTitle;
}; };
class VolumeSlider : public BWindow class VolumeSlider : public BWindow {
{ public:
public: VolumeSlider(BRect frame, bool dontBeep=false, int32 volumeWhich=0);
VolumeSlider(BRect frame, bool dontBeep=false, int32 volumeWhich=0); ~VolumeSlider();
~VolumeSlider();
void MessageReceived(BMessage*); void MessageReceived(BMessage*);
void WindowActivated(bool active); void WindowActivated(bool active);
private:
void UpdateVolume(BContinuousParameter* param); private:
media_node *aOutNode; void UpdateVolume(BContinuousParameter* param);
BParameterWeb* paramWeb;
BContinuousParameter* mixerParam; media_node *fAudioMixerNode;
float min, max, step; BParameterWeb* fParamWeb;
bool hasChanged; BContinuousParameter* fMixerParam;
bool dontBeep; float fMin, fMax, fStep;
SliderView *slider; bool fHasChanged;
bool fDontBeep;
SliderView *fSlider;
}; };
#endif #endif // VOLUMESLIDER_H