| 128 | } |
| 129 | |
| 130 | XnStatus PlayerImpl::SetSource(XnRecordMedium sourceType, const XnChar* strSource) |
| 131 | { |
| 132 | XnStatus nRetVal = XN_STATUS_OK; |
| 133 | |
| 134 | // NOTE: we don't want playback speed to affect getting to the first frame, so perform this |
| 135 | // without playback speed |
| 136 | XnDouble dPlaybackSpeed = GetPlaybackSpeed(); |
| 137 | SetPlaybackSpeed(XN_PLAYBACK_SPEED_FASTEST); |
| 138 | |
| 139 | //Right now the only record medium we support is a file |
| 140 | |
| 141 | m_sourceType = sourceType; |
| 142 | |
| 143 | switch (m_sourceType) |
| 144 | { |
| 145 | case XN_RECORD_MEDIUM_FILE: |
| 146 | { |
| 147 | nRetVal = xnOSStrCopy(m_strSource, strSource, sizeof(m_strSource)); |
| 148 | XN_IS_STATUS_OK(nRetVal); |
| 149 | nRetVal = ModulePlayer().SetInputStream(ModuleHandle(), this, &s_fileInputStream); |
| 150 | XN_IS_STATUS_OK(nRetVal); |
| 151 | break; |
| 152 | } |
| 153 | default: |
| 154 | XN_ASSERT(FALSE); |
| 155 | return XN_STATUS_BAD_PARAM; |
| 156 | } |
| 157 | |
| 158 | // now re-set playback speed |
| 159 | nRetVal = SetPlaybackSpeed(dPlaybackSpeed); |
| 160 | XN_IS_STATUS_OK(nRetVal); |
| 161 | |
| 162 | return XN_STATUS_OK; |
| 163 | } |
| 164 | |
| 165 | XnStatus PlayerImpl::GetSource(XnRecordMedium &sourceType, XnChar* strSource, XnUInt32 nBufSize) |
| 166 | { |
no test coverage detected