Пример #1
0
/**
 * Enables drawing of the color Video background.
 * If you want to disable it, call the Disable() function.
 */
void QmitkVideoBackground::Enable()
{
  UpdateVideo();
  Modified();

  m_QTimer->start();
}
Пример #2
0
void Loop()
{
	while(!OpQuit() && _sys_judge_event(NULL) >= 0)
	{
		if(!Handler()->FullSpeed())
			WaitTimer();
		UpdateSound();
		UpdateKeys();
		Handler()->OnLoop();
		UpdateVideo();
	}
}
Пример #3
0
bool CRecentlyAddedJob::DoWork()
{
  bool ret = true;
  if (m_flag & Audio)
    ret &= UpdateMusic();
  
  if (m_flag & Video)
    ret &= UpdateVideo();
  
  if (m_flag & Totals)
    ret &= UpdateTotal();
    
  return ret; 
}
Пример #4
0
bool CHomeShelfJob::DoWork()
{
  bool ret = true;
  if (m_flag & Audio)
    ret &= UpdateMusic();

  if (m_flag & Video)
    ret &= UpdateVideo();

  if (m_flag & Totals)
    ret &= UpdateTotal();

  return ret;
}
Пример #5
0
void QmitkVideoBackground::ResetVideoBackground()
{
  m_QTimer->setInterval(25);
  connect( m_QTimer, SIGNAL(timeout()), SLOT(UpdateVideo()) );
  m_renderWindowVectorInfo.clear();
}
Пример #6
0
////////////////
// Mouse events
void VideoSlider::OnMouse(wxMouseEvent &event) {
	// Coordinates
	int x = event.GetX();
	int y = event.GetY();
	bool shift = event.m_shiftDown;

	// Left click
	if (event.ButtonIsDown(wxMOUSE_BTN_LEFT)) {
		// Check if it's OK to drag
		bool canDrag = wxWindow::FindFocus() == this;
		if (!canDrag) {
			int tolerance = 4;
			int curX = GetXAtValue(GetValue());
			if (x-curX < -tolerance || x-curX > tolerance) canDrag = true;
		}

		// Drag
		if (canDrag) {
			// Shift click to snap to keyframe
			if (shift && Display) {
				wxArrayInt KeyFrames = Display->GetKeyFrames();
				int keys = KeyFrames.Count();
				int clickedFrame = GetValueAtX(x);
				int closest = 0;
				int cur;

				// Find closest
				for (int i=0;i<keys;i++) {
					cur = KeyFrames[i];
					if (abs(cur-clickedFrame) < abs(closest-clickedFrame)) {
						closest = cur;
					}
				}

				// Jump to frame
				if (closest == GetValue()) return;
				SetValue(closest);
			}

			// Normal click
			else {
				int go = GetValueAtX(x);
				if (go == GetValue()) return;
				SetValue(go);
			}
			Refresh(false);

			// Playing?
			if (Display->IsPlaying) {
				Display->Stop();
				UpdateVideo();
				Display->Play();
			}
			else UpdateVideo();
		}

		// Get focus
		SetFocus();
	}

	// Right/middle click
	if (event.ButtonDown(wxMOUSE_BTN_RIGHT) || event.ButtonDown(wxMOUSE_BTN_MIDDLE)) {
		SetFocus();
	}

	// Something else
	else if (!Display->IsPlaying) event.Skip();
}