* 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,16 +104,22 @@ VolumeControl::AttachedToWindow()
|
||||
|
||||
SetEventMask(_IsReplicant() ? 0 : B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
|
||||
|
||||
BMediaRoster::CurrentRoster()->StartWatching(this,
|
||||
fMixerControl->GainNode(), B_MEDIA_NEW_PARAMETER_VALUE);
|
||||
BMediaRoster* roster = BMediaRoster::CurrentRoster();
|
||||
if (roster != NULL && fMixerControl->GainNode() != media_node::null) {
|
||||
roster->StartWatching(this, fMixerControl->GainNode(),
|
||||
B_MEDIA_NEW_PARAMETER_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user