예제 #1
0
void ColorPicker::OnSlide(Slide *slide, int slideId, double pos)
{
	switch(slideId)
	{
	case SL_COLOR:
		{
			int color = pos*255;

			if(fixedColor <= FIX_BLUE)
			{
				switch(fixedColor)
				{
				case FIX_RED:
					r = color;			
					break;
					
				case FIX_GREEN:
					g = color;
					break;
					
				case FIX_BLUE:
					b = color;
					break;
				}

				UpdateSample(r, g, b);
			}
			else
			{
				double H, S, V;
				KrRGBA c;

				RGB_to_HSV(r, g, b, H, S, V);

				switch(fixedColor)
				{					
				case FIX_HUE:					
					c = HSV_to_RGB(color, S, V);
					break;
					
				case FIX_SATURATION:
					c = HSV_to_RGB(H, color, V);					
					break;
					
				case FIX_BRIGHTNESS:
					c = HSV_to_RGB(H, S, color);
					break;
				}

				UpdateSample(c.c.red, c.c.green, c.c.blue);
			}			

			UpdateCanvas(color, fixedColor);
		}
		break;
	}

	
}
예제 #2
0
파일: media.c 프로젝트: Keemotion/GPAC4iOS
GF_Err Media_UpdateSampleReference(GF_MediaBox *mdia, u32 sampleNumber, GF_ISOSample *sample, u64 data_offset)
{
	GF_Err e;
	u32 drefIndex, chunkNum, descIndex;
	u64 off, DTS;
	u8 isEdited;
	GF_DataEntryURLBox *Dentry;
	GF_SampleTableBox *stbl;

	if (!mdia) return GF_BAD_PARAM;
	stbl = mdia->information->sampleTable;

	//check we have the sampe dts
	e = stbl_GetSampleDTS(stbl->TimeToSample, sampleNumber, &DTS);
	if (e) return e;
	if (DTS != sample->DTS) return GF_BAD_PARAM;

	//get our infos
	stbl_GetSampleInfos(stbl, sampleNumber, &off, &chunkNum, &descIndex, &isEdited);

	//then check the data ref
	e = Media_GetSampleDesc(mdia, descIndex, NULL, &drefIndex);
	if (e) return e;
	Dentry = (GF_DataEntryURLBox*)gf_list_get(mdia->information->dataInformation->dref->other_boxes, drefIndex - 1);
	if (!Dentry) return GF_ISOM_INVALID_FILE;

	//we only modify self-contained data
	if (Dentry->flags == 1) return GF_ISOM_INVALID_MODE;

	//and we don't modify the media data
	return UpdateSample(mdia, sampleNumber, sample->dataLength, sample->CTS_Offset, data_offset, sample->IsRAP);
}
예제 #3
0
M4Err Media_UpdateSampleReference(MediaAtom *mdia, u32 sampleNumber, M4Sample *sample, u64 data_offset)
{
	M4Err e;
	u32 drefIndex, DTS, chunkNum, descIndex;
	u64 off;
	u8 isEdited;
	DataEntryURLAtom *Dentry;
	SampleTableAtom *stbl;
	M4Err stbl_AddAtom(SampleTableAtom *ptr, Atom *a);

	if (!mdia) return M4BadParam;
	stbl = mdia->information->sampleTable;

	//check we have the sampe dts
	e = stbl_GetSampleDTS(stbl->TimeToSample, sampleNumber, &DTS);
	if (e) return e;
	if (DTS != sample->DTS) return M4BadParam;

	//get our infos
	stbl_GetSampleInfos(stbl, sampleNumber, &off, &chunkNum, &descIndex, &isEdited);

	//then check the data ref
	e = Media_GetSampleDesc(mdia, descIndex, NULL, &drefIndex);
	if (e) return e;
	Dentry = (DataEntryURLAtom*)ChainGetEntry(mdia->information->dataInformation->dref->atomList, drefIndex - 1);
	if (!Dentry) return M4InvalidMP4File;

	//we only modify self-contained data
	if (Dentry->flags == 1) return M4InvalidMP4Mode;

	//and we don't modify the media data
	return UpdateSample(mdia, sampleNumber, sample->dataLength, sample->CTS_Offset, data_offset, sample->IsRAP);
}
예제 #4
0
void __stdcall M3D_set_3D_orientation(M3D_OBJECT* obj, float X_face, float Y_face, float Z_face, float X_up, float Y_up, float Z_up)
{
	if(((M3D_Object*)obj)->type)
	{
		M3D_Source* Result = (M3D_Source*)obj;

		Result->X_face = X_face;
		Result->Y_face = Y_face;
		Result->Z_face = Z_face;

		Result->X_up = X_up;
		Result->Y_up = Y_up;
		Result->Z_up = Z_up;

		UpdateSample(Result);
	}
	else
	{
		if(obj == (M3D_OBJECT*)&Listener)
		{
			Listener.X_face = X_face;
			Listener.Y_face = Y_face;
			Listener.Z_face = Z_face;
			Listener.X_face = X_up;
			Listener.Y_face = Y_up;
			Listener.Z_face = Z_up;

			UpdateAllSamples();
		}
	}
}
예제 #5
0
void CFontsPage::UpdateFormat(BOOL bSave)
{
	if(bSave){
	CString tmp;
		m_FacesCtl.GetWindowText(tmp);
		strcpy(m_fmtChar.szFaceName,tmp); m_fmtChar.dwMask|=CFM_FACE;
		m_SizeCtl.GetWindowText(tmp);
		m_fmtChar.yHeight = atoi(tmp)?(atoi(tmp)*REFS2PTS):m_fmtChar.yHeight;
		m_fmtChar.dwMask|=CFM_SIZE;
		if(m_BoldCtl.GetCheck())
			m_fmtChar.dwEffects|=CFE_BOLD;
		else
			m_fmtChar.dwEffects&=~CFE_BOLD;
		m_fmtChar.dwMask|=CFM_BOLD;
		if(m_ItalicCtl.GetCheck())
			m_fmtChar.dwEffects|=CFE_ITALIC;
		else
			m_fmtChar.dwEffects&=~CFE_ITALIC;
		m_fmtChar.dwMask|=CFM_ITALIC;
		if(m_StrikeoutCtl.GetCheck())
			m_fmtChar.dwEffects|=CFE_STRIKEOUT;
		else
			m_fmtChar.dwEffects&=~CFE_STRIKEOUT;
		m_fmtChar.dwMask|=CFM_STRIKEOUT;
		if(m_UnderlineCtl.GetCheck())
			m_fmtChar.dwEffects|=CFE_UNDERLINE;
		else
			m_fmtChar.dwEffects&=~CFE_UNDERLINE;
		m_fmtChar.dwMask|=CFM_UNDERLINE;
		if(m_CharsetCtl.IsWindowEnabled())
			m_fmtChar.bCharSet=m_CharsetCtl.GetItemData(m_CharsetCtl.GetCurSel());
		else
			m_fmtChar.bCharSet=DEFAULT_CHARSET;
		m_fmtChar.crTextColor = m_fgColorCtl.m_Color;
		m_fmtChar.dwMask|=CFM_COLOR;
		m_fmtChar.dwEffects&=~CFE_AUTOCOLOR;
		UpdateSample();
	}else{
		if(m_fmtChar.cbSize!=sizeof(m_fmtChar))
			memmove(&m_fmtChar,&m_fmtDefChar,sizeof(m_fmtChar));
		if(m_fmtChar.dwMask&CFM_FACE)
			m_FacesCtl.SelectString(0,m_fmtChar.szFaceName);
	CString tmp;
		if(m_fmtChar.dwMask&CFM_SIZE){
			tmp.Format("%d",m_fmtChar.yHeight/REFS2PTS);
			m_SizeCtl.SetWindowText(tmp);
		}
		if(m_fmtChar.dwMask&CFM_BOLD)
			m_BoldCtl.SetCheck((m_fmtChar.dwEffects&CFE_BOLD)?1:0);
		if(m_fmtChar.dwMask&CFM_ITALIC)
			m_ItalicCtl.SetCheck((m_fmtChar.dwEffects&CFE_ITALIC)?1:0);
		if(m_fmtChar.dwMask&CFM_STRIKEOUT)
			m_StrikeoutCtl.SetCheck((m_fmtChar.dwEffects&CFE_STRIKEOUT)?1:0);
		if(m_fmtChar.dwMask&CFM_UNDERLINE)
			m_UnderlineCtl.SetCheck((m_fmtChar.dwEffects&CFE_UNDERLINE)?1:0);
		m_fgColorCtl.m_Color = (m_fmtChar.dwMask&CFM_COLOR)?m_fmtChar.crTextColor:0;
		m_fgColorCtl.Invalidate();
		FillCharsets();
	}
}
예제 #6
0
BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
	CCreateContext* pContext)
{
	BOOL bSuccess;

	bSuccess = m_wndSplitter.CreateStatic(this, 1, 4);

	bSuccess = bSuccess &&
		m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CGelPreview),
			CSize(175, 100), pContext);

	bSuccess = bSuccess &&
		m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CGelPreview),
			CSize(175, 100), pContext);

	bSuccess = bSuccess &&
		m_wndSplitter.CreateView(0, 2, RUNTIME_CLASS(CGelView),
			CSize(150, 100), pContext);

	bSuccess = bSuccess &&
		m_wndSplitter.CreateView(0, 3, RUNTIME_CLASS(CGelPreview),
			CSize(175, 100), pContext);

	if (pContext->m_pCurrentDoc)
		UpdateSample((CGelDoc*)pContext->m_pCurrentDoc);

	return bSuccess;
}
예제 #7
0
void __stdcall M3D_set_3D_sample_occlusion(M3D_SAMPLE samp, float occlusion)
{
	M3D_Source* Sample = (M3D_Source*)samp;
	if(Sample->Obj.type)
	{
		Sample->occlusion = occlusion;
		UpdateSample(Sample);
	}
}
예제 #8
0
void ColorPicker::SetColor(int _r, int _g, int _b)
{
	r = _r;
	g = _g;
	b = _b;

	UpdateSlideColor(r, g, b, fixedColor);
	UpdateSample(r, g, b);
}
예제 #9
0
static void PASCAL    NewFont (HWND hDlg, BOOL TrustSizeEdit)
/* setting TrustSizeEdit to FALSE indicates that the contents of the
   ID_FONTSIZE edit box should not be used (this is used when this
   function is called for a size list-selection change, at which time
   the edit box has not been updated yet) */
{
    DWORD   d;
    int     i;
    BOOL    FontSizeOK;
    LOGFONT lf;
    HFONT   hOldFont;

    hOldFont = hNewFont;
    i = SendDlgItemMessage (hDlg, ID_FONT, LB_GETCURSEL, 0, 0L);
    if (i == LB_ERR) lf.lfFaceName[0] = 0;
    else {
	SendDlgItemMessage (hDlg, ID_FONT, LB_GETTEXT, i,
	                    (DWORD)(LPSTR)lf.lfFaceName);
    }
    if (TrustSizeEdit) {
        i = GetDlgItemInt (hDlg, ID_FONTSIZE, &FontSizeOK, FALSE);
    }
    else FontSizeOK = FALSE;
    if (FontSizeOK) {
	lf.lfHeight = i;
	lf.lfWidth = 0;
    }
    else {
	i = SendDlgItemMessage (hDlg, ID_FONTSIZE, CB_GETCURSEL, 0, 0L);
	if (i == CB_ERR) i = 0;
	d = SendDlgItemMessage (hDlg, ID_FONTSIZE, CB_GETITEMDATA, i, 0L);
	lf.lfHeight = HIWORD(d);
	lf.lfWidth = LOWORD(d);
    }
    lf.lfEscapement = 0;
    lf.lfOrientation = 0;
    lf.lfWeight = IsDlgButtonChecked (hDlg, ID_BOLD) ? 700 : 400;
    lf.lfItalic = 0;
    lf.lfUnderline = 0;
    lf.lfStrikeOut = 0;
    lf.lfCharSet = IsDlgButtonChecked (hDlg, ID_ANSI) ?
                   ANSI_CHARSET : OEM_CHARSET;
    lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
    lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
    lf.lfQuality = DEFAULT_QUALITY;
    lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;

    hNewFont = CreateFontIndirect (&lf);
    GetFontMetrics (hNewFont, &Metrics, FaceName);
    UpdateMaxRowCol (hDlg, hNewFont);
    UpdateSample (hDlg, hNewFont, &Metrics, FaceName);
    if (hOldFont) DeleteObject (hOldFont);
} /* NewFont */
예제 #10
0
void __stdcall M3D_set_3D_sample_playback_rate(M3D_SAMPLE samp, int playback_rate)
{
#ifdef LOG
	fprintf(Log, "M3D_set_3D_sample_playback_rate(%d, %d)\n", samp, playback_rate);
#endif

	M3D_Source* Result = (M3D_Source*)samp;
	if(Result->Obj.type && Result->Buffer.pAudioData)
	{
		Result->playback_rate = playback_rate;
		UpdateSample(Result);
	}
}
예제 #11
0
void __stdcall M3D_set_3D_sample_volume(M3D_SAMPLE samp, G32 volume)
{
#ifdef LOG
	fprintf(Log, "M3D_set_3D_sample_volume(%d, %f)\n", samp, volume);
#endif

	M3D_Source* Result = (M3D_Source*)samp;
	if(Result->Obj.type)
	{
		Result->volume = volume;
		UpdateSample(Result);
	}
}
예제 #12
0
void __stdcall M3D_set_3D_sample_cone(M3D_SAMPLE samp, float inner_angle, float outer_angle, int outer_volume)
{
	if(((M3D_Object*)samp)->type)
	{
		M3D_Source* Result = (M3D_Source*)samp;

		Result->inner_angle = inner_angle;
		Result->outer_angle = outer_angle;
		Result->outer_volume = outer_volume;

		UpdateSample(Result);
	}
}
예제 #13
0
void __stdcall M3D_set_3D_sample_distances(M3D_SAMPLE samp, float max_dist, float min_dist)
{
#ifdef LOG
	fprintf(Log, "M3D_set_3D_sample_distances(%d, %f, %f)\n", samp, max_dist, min_dist);
#endif

	M3D_Source* Result = (M3D_Source*)samp;
	if(Result->Obj.type)
	{
		Result->max_dist = max_dist;
		Result->min_dist = min_dist;
		UpdateSample(Result);
	}
}
예제 #14
0
LRESULT CNewDocWizStep1::OnHeight(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	if (wNotifyCode != EN_CHANGE)
		return S_OK;
		
	CComBSTR strValue;
	GetDlgItemText(wID, strValue.m_str);
	USES_CONVERSION;
	m_Data->m_fHeight = atof(OLE2T(strValue));

	SwapOrientationCheck(true/*bSetControls*/);
	UpdateSample(IDC_NEWDOC_SAMPLE);
	return S_OK;
}
void UtilCaptureImpl::DeviceImpl::ThreadFunc(void) {
    EnterCriticalSection(&cs);
    queues.resize(streams.size());
    LeaveCriticalSection(&cs);
    while (!stop) {
        std::deque<pxcU32> updates;
        UpdateSample(updates);
        
        for (std::deque<pxcU32>::iterator update=updates.begin();update!=updates.end();update++) {
            SampleContext context;
			PopContext(*update,context);
			SignalContext(context,ProcessSample(*update,context.storage));
        }
    }
}
예제 #16
0
void ColorPicker::OnEditChar(EditBox *edit, SDLKey key, int line)
{
	int value = atol(edit->GetText().c_str());
	bool bUpdateHSV = true;

	if( (edit == rEdit || edit == gEdit || edit == bEdit) &&
		(value < 0 || value > 255))
	{
		return;
	}

	if( edit == hEdit &&
		(value < 0 || value > 359))
	{
		return;
	}

	if( (edit == sEdit || edit == vEdit) &&
		(value < 0 || value > 100))
	{
		return;
	}

	if(edit == rEdit) r = value;
	else if(edit == gEdit) g = value;
	else if(edit == bEdit) b = value;
	else
	{
		double H, S, V;
		KrRGBA c;

		RGB_to_HSV(r, g, b, H, S, V);

		if(edit == hEdit) c = HSV_to_RGB(round(255*value/360.0), S, V);
		else if(edit == sEdit) c = HSV_to_RGB(H, round(255*value/100.0), V);
		else if(edit == vEdit) c = HSV_to_RGB(H, S, round(255*value/100.0));

		r = c.c.red;
		g = c.c.green;
		b = c.c.blue;

		bUpdateHSV = false;
	}

	UpdateColorControls();	
	UpdateSample(r, g, b, bUpdateHSV);
}
예제 #17
0
void __stdcall M3D_resume_3D_sample(M3D_SAMPLE samp)
{
#ifdef LOG
	fprintf(Log, "M3D_resume_3D_sample(%d)\n", samp);
#endif

	M3D_Source* Result = (M3D_Source*)samp;
	if(Result->Obj.type && Result->pSourceVoice && Result->Buffer.pAudioData)
	{
		UpdateSample(Result);
		Result->pSourceVoice->Start();

		EnterCriticalSection(&M3D_CS);
		Result->Status = SMP_PLAYING;
		LeaveCriticalSection(&M3D_CS);
	}
}
예제 #18
0
파일: media.c 프로젝트: Keemotion/GPAC4iOS
GF_Err Media_UpdateSample(GF_MediaBox *mdia, u32 sampleNumber, GF_ISOSample *sample, Bool data_only)
{
	GF_Err e;
	u32 drefIndex, chunkNum, descIndex;
	u64 newOffset, DTS;
	u8 isEdited;
	GF_DataEntryURLBox *Dentry;
	GF_SampleTableBox *stbl;

	if (!mdia || !sample || !sampleNumber || !mdia->mediaTrack->moov->mov->editFileMap)
		return GF_BAD_PARAM;
	
	stbl = mdia->information->sampleTable;

	if (!data_only) {
		//check we have the sampe dts
		e = stbl_GetSampleDTS(stbl->TimeToSample, sampleNumber, &DTS);
		if (e) return e;
		if (DTS != sample->DTS) return GF_BAD_PARAM;
	}

	//get our infos
	stbl_GetSampleInfos(stbl, sampleNumber, &newOffset, &chunkNum, &descIndex, &isEdited);

	//then check the data ref
	e = Media_GetSampleDesc(mdia, descIndex, NULL, &drefIndex);
	if (e) return e;
	Dentry = (GF_DataEntryURLBox*)gf_list_get(mdia->information->dataInformation->dref->other_boxes, drefIndex - 1);
	if (!Dentry) return GF_ISOM_INVALID_FILE;

	if (Dentry->flags != 1) return GF_BAD_PARAM;

	//MEDIA DATA EDIT: write this new sample to the edit temp file
	newOffset = gf_isom_datamap_get_offset(mdia->mediaTrack->moov->mov->editFileMap);
	if (sample->dataLength) {
		e = gf_isom_datamap_add_data(mdia->mediaTrack->moov->mov->editFileMap, sample->data, sample->dataLength);
		if (e) return e;
	}

	if (data_only) {
		stbl_SetSampleSize(stbl->SampleSize, sampleNumber, sample->dataLength);
		return stbl_SetChunkOffset(mdia, sampleNumber, newOffset);
	}
	return UpdateSample(mdia, sampleNumber, sample->dataLength, sample->CTS_Offset, newOffset, sample->IsRAP);
}
예제 #19
0
void CFontsPage::OnSelchangeFormatname() 
{
CFontFormat* fmt = (CFontFormat*)m_FormatsCtl.GetItemData(m_FormatsCtl.GetCurSel());
	if(m_fmtLast){
		memmove(&m_fmtLast->m_fmtChar,&m_fmtChar,sizeof(m_fmtLast->m_fmtChar));
		if(m_fmtLast->m_Flags&CFontFormat::flagBGColor)
			m_fmtLast->m_bgColor = m_bgColorCtl.m_Color;
	}
BOOL bBG = fmt->m_Flags&CFontFormat::flagBGColor;
	m_bgColorCtl.EnableWindow(bBG);
	m_TipCtl.SetWindowText(fmt->m_Tip);
	m_fmtLast = fmt;
	memmove(&m_fmtChar,&m_fmtLast->m_fmtChar,sizeof(m_fmtChar));
	if(bBG){
		m_bgColorCtl.m_Color = m_fmtLast->m_bgColor;
		m_bgColorCtl.Invalidate();
	}
	UpdateFormat(FALSE);
	UpdateSample();
}
예제 #20
0
void __stdcall M3D_start_3D_sample(M3D_SAMPLE samp)
{
#ifdef LOG
	fprintf(Log, "M3D_start_3D_sample(%d)\n", samp);
#endif

	M3D_Source* Result = (M3D_Source*)samp;
	if(Result->Obj.type && Result->pSourceVoice && Result->Buffer.pAudioData)
	{
		Result->Buffer.LoopBegin = Result->loop_start_offset / Result->Format.nBlockAlign;
		Result->Buffer.LoopLength = (Result->loop_end_offset > 0) ? Result->loop_end_offset / Result->Format.nBlockAlign : 0;
		Result->Buffer.LoopCount = (Result->loops > 0) ? Result->loops - 1 : XAUDIO2_LOOP_INFINITE;

		Result->pSourceVoice->SubmitSourceBuffer(&Result->Buffer);
		UpdateSample(Result);
		Result->pSourceVoice->Start();

		EnterCriticalSection(&M3D_CS);
		Result->Status = SMP_PLAYING;
		LeaveCriticalSection(&M3D_CS);
	}
}
예제 #21
0
M4Err Media_UpdateSample(MediaAtom *mdia, u32 sampleNumber, M4Sample *sample)
{
	M4Err e;
	u32 drefIndex, chunkNum, descIndex, DTS;
	u64 newOffset;
	u8 isEdited;
	DataEntryURLAtom *Dentry;
	SampleTableAtom *stbl;

	M4Err stbl_AddAtom(SampleTableAtom *ptr, Atom *a);

	if (!mdia || !sample || !sampleNumber || !mdia->mediaTrack->moov->mov->editFileMap)
		return M4BadParam;
	
	stbl = mdia->information->sampleTable;

	//check we have the sampe dts
	e = stbl_GetSampleDTS(stbl->TimeToSample, sampleNumber, &DTS);
	if (e) return e;
	if (DTS != sample->DTS) return M4BadParam;

	//get our infos
	stbl_GetSampleInfos(stbl, sampleNumber, &newOffset, &chunkNum, &descIndex, &isEdited);

	//then check the data ref
	e = Media_GetSampleDesc(mdia, descIndex, NULL, &drefIndex);
	if (e) return e;
	Dentry = (DataEntryURLAtom*)ChainGetEntry(mdia->information->dataInformation->dref->atomList, drefIndex - 1);
	if (!Dentry) return M4InvalidMP4File;

	if (Dentry->flags != 1) return M4BadParam;

	//MEDIA DATA EDIT: write this new sample to the edit temp file
	newOffset = DataMap_GetTotalOffset(mdia->mediaTrack->moov->mov->editFileMap);
	e = DataMap_AddData(mdia->mediaTrack->moov->mov->editFileMap, sample->data, sample->dataLength);
	if (e) return e;

	return UpdateSample(mdia, sampleNumber, sample->dataLength, sample->CTS_Offset, newOffset, sample->IsRAP);
}
예제 #22
0
void CSearchReplaceDlg::PopUpdatesFreeze()
{
	--m_nUpdatesFreeze;
	ASSERT(m_nUpdatesFreeze >= 0);
	if (m_nUpdatesFreeze == 0)
	{
		// Block updates freeze (to avoid this to be recursive).
		m_nUpdatesFreeze = 1;

		UpdateData();

		// Update renaming sample.
		UpdateSample();

		// Colour the syntax.
		ColorSearchText();
		ColorReplacementText();

		// Un-block updates freeze.
		m_nUpdatesFreeze = 0;
	}
}
예제 #23
0
bool
AbstractTask::Update(const AircraftState &state, 
                     const AircraftState &state_last,
                     const GlidePolar &glide_polar)
{
  stats.task_valid = CheckTask();

  const bool full_update = 
    CheckTransitions(state, state_last) ||
    (active_task_point != active_task_point_last);

  UpdateStatsTimes(state);
  UpdateStatsDistances(state.location, full_update);
  UpdateGlideSolutions(state, glide_polar);
  bool sample_updated = UpdateSample(state, glide_polar, full_update);
  UpdateStatsSpeeds(state, state_last);
  UpdateFlightMode();

  active_task_point_last = active_task_point;

  return sample_updated || full_update;
}
예제 #24
0
void __stdcall M3D_set_3D_position(M3D_OBJECT* obj, float X, float Y, float Z)
{
	if(((M3D_Object*)obj)->type)
	{
		M3D_Source* Result = (M3D_Source*)obj;

		Result->X = X;
		Result->Y = Y;
		Result->Z = Z;

		UpdateSample(Result);
	}
	else
	{
		if(obj == (M3D_OBJECT*)&Listener)
		{
			Listener.X = X;
			Listener.Y = Y;
			Listener.Z = Z;

			UpdateAllSamples();
		}
	}
}
예제 #25
0
void __stdcall M3D_set_3D_velocity_vector(M3D_OBJECT* obj, float dX_per_ms, float dY_per_ms, float dZ_per_ms)
{
	if(((M3D_Object*)obj)->type)
	{
		M3D_Source* Result = (M3D_Source*)obj;

		Result->dX_per_ms = dX_per_ms;
		Result->dY_per_ms = dY_per_ms;
		Result->dZ_per_ms = dZ_per_ms;

		UpdateSample(Result);
	}
	else
	{
		if(obj == (M3D_OBJECT*)&Listener)
		{
			Listener.dX_per_ms = dX_per_ms;
			Listener.dY_per_ms = dY_per_ms;
			Listener.dZ_per_ms = dZ_per_ms;

			UpdateAllSamples();
		}
	}
}
예제 #26
0
void UpdateAllSamples(void)
{
	Listener.X3DListener.Position.x = Listener.X;
	Listener.X3DListener.Position.y = Listener.Y;
	Listener.X3DListener.Position.z = Listener.Z;

	Listener.X3DListener.OrientFront.x = Listener.X_face;
	Listener.X3DListener.OrientFront.y = Listener.Y_face;
	Listener.X3DListener.OrientFront.z = Listener.Z_face;

	Listener.X3DListener.OrientTop.x = Listener.X_up;
	Listener.X3DListener.OrientTop.y = Listener.Y_up;
	Listener.X3DListener.OrientTop.z = Listener.Z_up;

	Listener.X3DListener.Velocity.x = Listener.dX_per_ms * 1000.0f;
	Listener.X3DListener.Velocity.y = Listener.dY_per_ms * 1000.0f;
	Listener.X3DListener.Velocity.z = Listener.dZ_per_ms * 1000.0f;

	if(Samples)
	{
		for(int i = 0; i < MAX_SAMPLES_COUNT; i++)
			UpdateSample(&Samples[i]);
	}
}
예제 #27
0
ColorPicker::ColorPicker(int _r, int _g, int _b)
	: Panel("DlgColorPicker", (GameControl::Get()->Width() - WIDTH)/2, 
				          (GameControl::Get()->Height() - HEIGHT)/2,
						  WIDTH, HEIGHT)
{
	SetModal();

	Text *text;
	Button *button;

	//Title
	text = AddText("Color Picker", CENTER_TEXT, 5);
	int y = DrawHLine(text->Down() + 2);

	//Body
	canvas = new ColorCanvas(this);
	oldColor = new ColorSampleOfPicker(this);
	newColor = new ColorSampleOfPicker(this);

	canvas->SetPos(10, y + 2);	
	
	

	colorSlide = AddSlide(canvas->Right() + 5, canvas->Top(), 20, 256, SL_COLOR);
	colorSlide->SetPos(1.0);


	newColor->SetPos(colorSlide->Right() + 5, colorSlide->Top());
	oldColor->SetPos(newColor->Left(), newColor->Down());

	text = AddText("       Red: ", oldColor->Left(), oldColor->Down() + 16);
	rEdit = AddEditBox(text->Right(), text->Top(), 32); rEdit->SetNumeric(0, 255, 1);

	text = AddText("     Green: ", text->Left(), rEdit->Down() + 2);
	gEdit = AddEditBox(text->Right(), text->Top(), 32); gEdit->SetNumeric(0, 255, 1);

	text = AddText("      Blue: ", text->Left(), gEdit->Down() + 2);
	bEdit = AddEditBox(text->Right(), text->Top(), 32); bEdit->SetNumeric(0, 255, 1);


	text = AddText("       Hue: ", text->Left(), bEdit->Down() + 16);
	hEdit = AddEditBox(text->Right(), text->Top(), 32); hEdit->SetNumeric(0, 359, 1);

	text = AddText("Saturation: ", text->Left(), hEdit->Down() + 2);
	sEdit = AddEditBox(text->Right(), text->Top(), 32); sEdit->SetNumeric(0, 100, 1);

	text = AddText("Brightness: ", text->Left(), sEdit->Down() + 2);
	vEdit = AddEditBox(text->Right(), text->Top(), 32); vEdit->SetNumeric(0, 100, 1);

	listFix = AddListPop(oldColor->Left(), vEdit->Down() + 16, 104, 0, LS_FIX_COLOR);

	//Close
	y = DrawHLine(canvas->Down() + 2);

	button = AddButton("Ok", (WIDTH-135)/2, y, 0, 0, OK_BUTTON); SetConfirmButton(button);
	button = AddButton("Cancel", button->Right()+8, y, 0, 0, CANCEL_BUTTON); SetCancelButton(button);

	

	listFix->AddText("Red");
	listFix->AddText("Green");
	listFix->AddText("Blue");

	listFix->AddText("Hue");
	listFix->AddText("Saturation");
	listFix->AddText("Brightness");

	listFix->SetText("Red");	
	fixedColor = FIX_RED;
	r = _r;
	g = _g;
	b = _b;
	
	oldColor->SetColor(r, g, b);
	

	colorSlide->SetPos(r / 255.0);

	UpdateSample(r, g, b);	
	UpdateCanvas(r, fixedColor);
	UpdateSlideColor(r, g, b, fixedColor);
}