Exemple #1
0
void
VolumeSlider::MouseDown(BPoint point)
{
	if (!fSoundPlayer || !Bounds().InsetBySelf(2,2).Contains(point))
		return;

	_UpdateVolume(point);
	SetTracking(true);
	SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS);
}
Exemple #2
0
void
VolumeSlider::MouseUp(BPoint point)
{
	if (!IsTracking())
		return;
	if (fSoundPlayer && Bounds().InsetBySelf(2,2).Contains(point)) {
		_UpdateVolume(point);
	}
	
	Invoke();
	SetTracking(false);
	Draw(Bounds());
	Flush();
}
void
TransportControlGroup::MessageReceived(BMessage* message)
{
	switch (message->what) {
		case MSG_PLAY:
			_TogglePlaying();
			break;
		case MSG_STOP:
			_Stop();
			break;

		case MSG_REWIND:
			_Rewind();
			break;
		case MSG_FORWARD:
			_Forward();
			break;

		case MSG_SKIP_BACKWARDS:
			_SkipBackward();
			break;
		case MSG_SKIP_FORWARD:
			_SkipForward();
			break;

		case MSG_SET_VOLUME:
			_UpdateVolume();
			break;
		case MSG_SET_MUTE:
			_ToggleMute();
			break;

		case MSG_SEEK:
			_UpdatePosition();
			break;

		default:
		    BView::MessageReceived(message);
		    break;
	}
}
Exemple #4
0
void 
VolumeSlider::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
{
	if (!IsTracking())
		return;
		
	uint32 mouseButtons;
	BPoint where;
	GetMouse(&where, &mouseButtons, true);
	
	// button not pressed, exit
	if (! (mouseButtons & B_PRIMARY_MOUSE_BUTTON)) {
		Invoke();
		SetTracking(false);
	}
		
	if (!fSoundPlayer || !Bounds().InsetBySelf(2,2).Contains(point))
		return;

	_UpdateVolume(point);
}