* As Stephan pointed out, the roster will be NULL if the media server is not
running. Thanks! That's just another thing we should improve in R2. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30062 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -104,17 +104,23 @@ VolumeControl::AttachedToWindow()
|
|||||||
|
|
||||||
SetEventMask(_IsReplicant() ? 0 : B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
|
SetEventMask(_IsReplicant() ? 0 : B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
|
||||||
|
|
||||||
BMediaRoster::CurrentRoster()->StartWatching(this,
|
BMediaRoster* roster = BMediaRoster::CurrentRoster();
|
||||||
fMixerControl->GainNode(), B_MEDIA_NEW_PARAMETER_VALUE);
|
if (roster != NULL && fMixerControl->GainNode() != media_node::null) {
|
||||||
|
roster->StartWatching(this, fMixerControl->GainNode(),
|
||||||
|
B_MEDIA_NEW_PARAMETER_VALUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VolumeControl::DetachedFromWindow()
|
VolumeControl::DetachedFromWindow()
|
||||||
{
|
{
|
||||||
BMediaRoster::CurrentRoster()->StopWatching(this, fMixerControl->GainNode(),
|
BMediaRoster* roster = BMediaRoster::CurrentRoster();
|
||||||
|
if (roster != NULL && fMixerControl->GainNode() != media_node::null) {
|
||||||
|
roster->StopWatching(this, fMixerControl->GainNode(),
|
||||||
B_MEDIA_NEW_PARAMETER_VALUE);
|
B_MEDIA_NEW_PARAMETER_VALUE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user