コード例 #1
0
ファイル: SyntroReview.cpp プロジェクト: robotage/SyntroApps
void SyntroReview::newPlayMode(int playMode)
{
	int oldPlayMode;

	if (m_CFSState != SYNTROREVIEW_CFS_STATE_OPEN)
		return;												// no open file anyway
	oldPlayMode = m_playMode;
	m_playMode = playMode;
	if (playMode == SYNTROREVIEW_PLAY_MODE_STOPPED) { 		// now stopped due to hit start of file
		if ((oldPlayMode == SYNTROREVIEW_PLAY_MODE_REVERSE) || (oldPlayMode == SYNTROREVIEW_PLAY_MODE_FASTREVERSE)) {
			if (m_buttonLoop->isChecked()) {				// need to go into reverse play again
				emit setFrameIndex(m_fileLength - 1, oldPlayMode, false);	// reset to end of file
				m_playMode = oldPlayMode;					// restore the mode
				return;
			}
		}
		setStoppedPlayControls();
		return;
	}
	if (playMode == SYNTROREVIEW_PLAY_MODE_PAUSED) {		// now paused as hit end of file
		if ((oldPlayMode == SYNTROREVIEW_PLAY_MODE_PLAY) || (oldPlayMode == SYNTROREVIEW_PLAY_MODE_FASTFORWARD)) {
			if (m_buttonLoop->isChecked()) {				// need to go into forward play again
				emit setFrameIndex(0, oldPlayMode, false);	// reset to start of file
				m_playMode = oldPlayMode;					// restore the mode
				return;
			}
		}
		setPausedPlayControls();
		return;
	}
}
コード例 #2
0
ファイル: kkslidervolume.cpp プロジェクト: kxtry/kxfw-example
void KKSliderVolume::on_mute_clicked()
{
	int index = m_mute->frameIndex();
	index = index == 1 ? 0 : 1;
	m_mute->setFrameIndex(index);
	setFrameIndex(index);
	m_sliderFrame->setEnabled(!index);
	emit muteChanged(index == 1);
}
コード例 #3
0
ファイル: SyntroReview.cpp プロジェクト: robotage/SyntroApps
void SyntroReview::sliderMoved(int index)
{
	if (m_CFSState != SYNTROREVIEW_CFS_STATE_OPEN)
		return;												// only care if there's an open file
	if (m_playMode != SYNTROREVIEW_PLAY_MODE_PAUSED) {
		m_playMode = SYNTROREVIEW_PLAY_MODE_PAUSED;			// make sure we are paused
		setPausedPlayControls();
	}
	emit setFrameIndex(index, SYNTROREVIEW_PLAY_MODE_PAUSED, false);	// tell the client
}
コード例 #4
0
		//----------
		shared_ptr<Frame> NullDevice::getFrame() {
			ofSleepMillis(1e3 / this->settings.frameRate);

			auto frame = FramePool::X().getAvailableAllocatedFrame(this->settings.width, this->settings.height, OF_PIXELS_MONO);
			frame->getPixels().set(0, 0);
			frame->setFrameIndex(this->frameIndex++);
			frame->setTimestamp(chrono::high_resolution_clock::now() - this->startTime);

			return frame;
		}
コード例 #5
0
ファイル: kkslidervolume.cpp プロジェクト: kxtry/kxfw-example
void KKSliderVolume::setVolume( float val, bool mute )
{
	if(!mute)
	{
		m_slider->setValue(val);
	}
	int idx = mute ? 1 : 0;
	m_mute->setFrameIndex(idx);
	setFrameIndex(idx);
	m_sliderFrame->setEnabled(!mute);
}
コード例 #6
0
		//---------
		shared_ptr<Frame> VideoInput::getFrame() {
			auto frame = FramePool::X().getAvailableAllocatedFrame(this->device->getWidth(this->deviceIndex)
				, this->device->getHeight(this->deviceIndex)
				, ofPixelFormat::OF_PIXELS_RGB);

			this->device->getPixels(this->deviceIndex, frame->getPixels().getData(), true, true);

			frame->setTimestamp(chrono::high_resolution_clock::now() - this->timerStart);
			frame->setFrameIndex(this->frameIndex);
			return frame;
		}
コード例 #7
0
ファイル: SyntroReview.cpp プロジェクト: robotage/SyntroApps
void SyntroReview::playButtonClicked(QAbstractButton *button)
{
	if (m_CFSState != SYNTROREVIEW_CFS_STATE_OPEN)
		return;												// no open file anyway

	if (button == m_buttonStop){
		setStoppedPlayControls();
		m_playMode = SYNTROREVIEW_PLAY_MODE_STOPPED;
	} else if (button == m_buttonPause){
		setPausedPlayControls();
		m_playMode = SYNTROREVIEW_PLAY_MODE_PAUSED;
	} else if (button == m_buttonFramePlus){
		setPausedPlayControls();
		m_playMode = SYNTROREVIEW_PLAY_MODE_PAUSED;
		if (m_currentIndex < m_fileLength -1)
			emit setFrameIndex(m_currentIndex + 1, SYNTROREVIEW_PLAY_MODE_PAUSED, false);
	} else if (button == m_buttonPlay){
		setPlayingPlayControls();
		m_playMode = SYNTROREVIEW_PLAY_MODE_PLAY;
	} else if (button == m_buttonFrameMinus){
		setPausedPlayControls();
		m_playMode = SYNTROREVIEW_PLAY_MODE_PAUSED;
		if (m_currentIndex > 1)
			emit setFrameIndex(m_currentIndex - 1, SYNTROREVIEW_PLAY_MODE_PAUSED, false);
	} else if (button == m_buttonReverse){
		setReversePlayControls();
		m_playMode = SYNTROREVIEW_PLAY_MODE_REVERSE;
	} else if (button == m_buttonFastReverse){
		setFastReversePlayControls();
		m_playMode = SYNTROREVIEW_PLAY_MODE_FASTREVERSE;
	} else if (button == m_buttonFastForward){
		setFastForwardPlayControls();
		m_playMode = SYNTROREVIEW_PLAY_MODE_FASTFORWARD;
	}
	emit setPlayMode(m_playMode, false);
}