当前位置: 首页>>代码示例>>C++>>正文


C++ WDL_FastString类代码示例

本文整理汇总了C++中WDL_FastString的典型用法代码示例。如果您正苦于以下问题:C++ WDL_FastString类的具体用法?C++ WDL_FastString怎么用?C++ WDL_FastString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了WDL_FastString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RulerWndProc

static LRESULT CALLBACK RulerWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	if (uMsg == WM_SETCURSOR && g_actionInProgress && g_actionInProgress->SetMouseCursor)
	{
		if (HCURSOR cursor = g_actionInProgress->SetMouseCursor(BR_ContinuousAction::RULER))
		{
			SetCursor(cursor);
			return 1;
		}
	}
	else if (uMsg == WM_MOUSEMOVE && g_actionInProgress && g_actionInProgress->SetTooltip)
	{
		WDL_FastString tooltip = g_actionInProgress->SetTooltip(BR_ContinuousAction::RULER);
		if (tooltip.GetLength())
		{
			POINT p = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
			ClientToScreen(hwnd, &p);
			SetTooltip(tooltip.Get(), &p);
		}
		else
		{
			SetTooltip(NULL, NULL);
		}
	}
	return g_rulerWndProc(hwnd, uMsg, wParam, lParam);
}
开发者ID:wolqws,项目名称:sws,代码行数:26,代码来源:BR_ContinuousActions.cpp

示例2: SaveCueBusIniFile

void SaveCueBusIniFile(int _confId, const char* _busName, int _type, bool _trTemplate, const char* _trTemplatePath, bool _showRouting, int _soloDefeat, bool _sendToMaster, int* _hwOuts)
{
	if (_confId>=0 && _confId<SNM_MAX_CUE_BUSS_CONFS && _busName && _trTemplatePath && _hwOuts)
	{
		char iniSection[64]="";
		if (_snprintfStrict(iniSection, sizeof(iniSection), "CueBuss%d", _confId+1) > 0)
		{
			char buf[16]="", slot[16]="";
			WDL_FastString escapedStr;
			escapedStr.SetFormatted(256, "\"%s\"", _busName);
			WritePrivateProfileString(iniSection,"name",escapedStr.Get(),g_SNM_IniFn.Get());
			if (_snprintfStrict(buf, sizeof(buf), "%d" ,_type) > 0)
				WritePrivateProfileString(iniSection,"reatype",buf,g_SNM_IniFn.Get());
			WritePrivateProfileString(iniSection,"track_template_enabled",_trTemplate ? "1" : "0",g_SNM_IniFn.Get());
			escapedStr.SetFormatted(SNM_MAX_PATH, "\"%s\"", _trTemplatePath);
			WritePrivateProfileString(iniSection,"track_template_path",escapedStr.Get(),g_SNM_IniFn.Get());
			WritePrivateProfileString(iniSection,"show_routing",_showRouting ? "1" : "0",g_SNM_IniFn.Get());
			WritePrivateProfileString(iniSection,"send_to_masterparent",_sendToMaster ? "1" : "0",g_SNM_IniFn.Get());
			if (_snprintfStrict(buf, sizeof(buf), "%d", _soloDefeat) > 0)
				WritePrivateProfileString(iniSection,"solo_defeat",buf,g_SNM_IniFn.Get());
			for (int i=0; i<SNM_MAX_HW_OUTS; i++) 
				if (_snprintfStrict(slot, sizeof(slot), "hwout%d", i+1) > 0 && _snprintfStrict(buf, sizeof(buf), "%d", _hwOuts[i]) > 0)
					WritePrivateProfileString(iniSection,slot,_hwOuts[i]?buf:NULL,g_SNM_IniFn.Get());
		}
	}
}
开发者ID:Jeff0S,项目名称:sws,代码行数:26,代码来源:SnM_CueBuss.cpp

示例3: main

int main(int argc, char **argv)
{
  if (argc != 2) { fprintf(stderr,"usage: preproc_test filename\n"); return 0; }
  FILE *fp =fopen(argv[1],"rb");
  if (!fp)  { fprintf(stderr,"error opening '%s'\n",argv[1]); return 1; }

  int insec=0;
  WDL_FastString cursec;
  for (;;)
  {
    char buf[4096];
    buf[0]=0;
    fgets(buf,sizeof(buf),fp);
    if (!buf[0]) break;
    char *p=buf;
    while (*p == ' ' || *p == '\t') p++;
    if (p[0] == '@') 
    {
      insec=1;
      if (ppOut((char*)cursec.Get())) { fprintf(stderr,"Error preprocessing %s!\n",argv[1]); return -1; }
      cursec.Set("");
    }
    else if (insec)
    {
      cursec.Append(buf);
      continue;
    }
    printf("%s",buf);
  }
  if (ppOut((char*)cursec.Get())) { fprintf(stderr,"Error preprocessing %s!\n",argv[1]); return -1; }

  fclose(fp);
  return 0;
}
开发者ID:Brado231,项目名称:Faderport_XT,代码行数:34,代码来源:preproc_test.cpp

示例4: FindFirstUnusedGroup

int FindFirstUnusedGroup()
{
	bool grp[SNM_MAX_TRACK_GROUPS];
	memset(grp, 0, sizeof(bool)*SNM_MAX_TRACK_GROUPS);

	for (int i=0; i <= GetNumTracks(); i++) // incl. master
	{
		//JFB TODO? exclude selected tracks?
		if (MediaTrack* tr = CSurf_TrackFromID(i, false))
		{
			SNM_ChunkParserPatcher p(tr);
			WDL_FastString grpLine;
			if (p.Parse(SNM_GET_SUBCHUNK_OR_LINE, 1, "TRACK", "GROUP_FLAGS", 0, 0, &grpLine, NULL, "TRACKHEIGHT"))
			{
				LineParser lp(false);
				if (!lp.parse(grpLine.Get())) {
					for (int j=1; j < lp.getnumtokens(); j++) { // skip 1st token GROUP_FLAGS
						int val = lp.gettoken_int(j);
						for (int k=0; k < SNM_MAX_TRACK_GROUPS; k++) {
							int grpMask = int(pow(2.0, k*1.0));
							grp[k] |= ((val & grpMask) == grpMask);
						}
					}
				}
			}
		}
	}

	for (int i=0; i < SNM_MAX_TRACK_GROUPS; i++) 
		if (!grp[i]) return i;

	return -1;
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:33,代码来源:SnM_Track.cpp

示例5: CommandTimer

void CommandTimer (COMMAND_T* ct, int val /*= 0*/, int valhw /*= 0*/, int relmode /*= 0*/, HWND hwnd /*= NULL*/, bool commandHook2 /*= false*/)
{
	#ifdef WIN32
		LARGE_INTEGER ticks, start, end;
		QueryPerformanceFrequency(&ticks);
		QueryPerformanceCounter(&start);
	#else
		timeval start, end;
		gettimeofday(&start, NULL);
	#endif

	if (commandHook2)
		ct->onAction(ct, val, valhw, relmode, hwnd);
	else
		ct->doCommand(ct);

	#ifdef WIN32
		QueryPerformanceCounter(&end);
		int msTime = (int)((double)(end.QuadPart - start.QuadPart) * 1000 / (double)ticks.QuadPart + 0.5);
	#else
		gettimeofday(&end, NULL);
		int msTime = (int)((double)(end.tv_sec - start.tv_sec) * 1000 + (double)(end.tv_usec - start.tv_usec) / 1000 + 0.5);
	#endif

	WDL_FastString string;
	string.AppendFormatted(256, "%d ms to execute: %s\n", msTime, ct->accel.desc);
	ShowConsoleMsg(string.Get());
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:28,代码来源:BR_Timer.cpp

示例6: ResolveMissingRecv

// Return TRUE on delete send
bool ResolveMissingRecv(MediaTrack* tr, int iSend, TrackSend* ts, WDL_PtrList<TrackSendFix>* pFix)
{
	WDL_FastString str;
	char* cName = (char*)GetSetMediaTrackInfo(tr, "P_NAME", NULL);
	if (!cName || !cName[0])
		cName = (char*)__LOCALIZE("(unnamed)","sws_DLG_114");
	str.SetFormatted(200, __LOCALIZE_VERFMT("Send %d on track %d \"%s\" is missing its receive track!","sws_DLG_114"), iSend+1, CSurf_TrackToID(tr, false), cName);

	g_cErrorStr = str.Get();
	g_ts = ts;
	g_send = tr;
	g_recv = NULL;

	DialogBox(g_hInst, MAKEINTRESOURCE(IDD_RECVMISSING), g_hwndParent, doResolve);

	if (g_iResolveRet == 1)
		return true;
	else if (g_iResolveRet == 2)
	{
		GUID* newGuid = (GUID*)GetSetMediaTrackInfo(g_recv, "GUID", NULL);
		if (pFix)
			pFix->Add(new TrackSendFix(ts->GetGuid(), newGuid));
		ts->SetGuid(newGuid);
	}

	return false;
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:28,代码来源:TrackSends.cpp

示例7: QueryPerformanceCounter

	void BR_Timer::Progress (const char* message /*= NULL*/)
	{
		#ifdef WIN32
			LARGE_INTEGER end, ticks;
			QueryPerformanceCounter(&end);
			QueryPerformanceFrequency(&ticks);
			LARGE_INTEGER start = m_start;
			if (m_paused) // in case timer is still paused
				start.QuadPart += end.QuadPart - m_pause.QuadPart;

			double msTime = (double)(end.QuadPart - start.QuadPart) * 1000 / (double)ticks.QuadPart;
		#else
			timeval end;
			gettimeofday(&end, NULL);
			timeval start = m_start;
			if (m_paused) // in case timer is still paused
			{
				timeval temp;
				timersub(&end, &m_pause, &temp);
				timeradd(&m_start, &temp, &start);
			}

			double msTime = (double)(end.tv_sec - start.tv_sec) * 1000 + (double)(end.tv_usec - start.tv_usec) / 1000;
		#endif

		bool paused = m_paused;
		this->Pause();  // ShowConsoleMsg wastes time and Progress can be called at any time during measurement

		WDL_FastString string;
		string.AppendFormatted(256, "%.3f ms to execute: %s\n", msTime, message ? message : m_message.Get());
		ShowConsoleMsg(string.Get());

		if (!paused)  // resume only if time was not paused in the first place
			this->Resume();
	}
开发者ID:AusRedNeck,项目名称:sws,代码行数:35,代码来源:BR_Timer.cpp

示例8: IsEmpty

// different from checking a PCM source: this method deals with the chunk
bool SNM_TakeParserPatcher::IsEmpty(int _takeIdx)
{
	WDL_FastString tkChunk;
	if (GetTakeChunk(_takeIdx, &tkChunk))
		return (
			!strncmp(tkChunk.Get(), "TAKE NULL", 9) || // empty take
			strstr(tkChunk.Get(), "<SOURCE EMPTY")); // take with an empty source
	return false;
}
开发者ID:Jeff0S,项目名称:sws,代码行数:10,代码来源:SnM_Chunk.cpp

示例9: GetFXChain

// Functions for getting/setting track FX chains
void GetFXChain(MediaTrack* tr, WDL_TypedBuf<char>* buf)
{
	SNM_ChunkParserPatcher p(tr);
	WDL_FastString chainChunk;
	if (p.GetSubChunk("FXCHAIN", 2, 0, &chainChunk, "<ITEM") > 0) {
		buf->Resize(chainChunk.GetLength() + 1);
		strcpy(buf->Get(), chainChunk.Get());
	}
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:10,代码来源:TrackFX.cpp

示例10: SetFXChain

void SetFXChain(MediaTrack* tr, const char* str)
{
	SNM_FXChainTrackPatcher p(tr);
	WDL_FastString chainChunk;
	// adapt FX chain format (the SNM_FXChainTrackPatcher uses the .RFXChain file format)
	if (str && !strncmp(str, "<FXCHAIN", 8)) {
		chainChunk.Set(strchr(str, '\n') + 1); // removes the line starting with "<FXCHAIN"
		chainChunk.SetLen(chainChunk.GetLength()-2); // remove trailing ">\n"
	}
	p.SetFXChain(str ? &chainChunk : NULL);
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:11,代码来源:TrackFX.cpp

示例11: ItemNotesMatch

bool ItemNotesMatch(MediaItem* _item, const char* _searchStr)
{
	bool match = false;
	if (_item)
	{
		SNM_ChunkParserPatcher p(_item);
		WDL_FastString notes;
		if (p.GetSubChunk("NOTES", 2, 0, &notes, "VOLPAN") >= 0) // rmk: we use VOLPAN as it also exists for empty items
			//JFB TODO? we compare a formated string with a normal one here, oh well..
			match = (stristr(notes.Get(), _searchStr) != NULL);
	}
	return match;
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:13,代码来源:SnM_Find.cpp

示例12: PromptClearProjectStartupAction

int PromptClearProjectStartupAction(bool _clear)
{
	int r=0, cmdId=SNM_NamedCommandLookup(g_prjActions.Get()->Get());
	if (cmdId)
	{
		WDL_FastString msg;
		msg.AppendFormatted(256,
			_clear ?
				__LOCALIZE_VERFMT("Are you sure you want to clear the current startup action: '%s'?","sws_mbox") :
				__LOCALIZE_VERFMT("Are you sure you want to replace the current startup action: '%s'?","sws_mbox"),
			kbd_getTextFromCmd(cmdId, NULL));
		r = MessageBox(GetMainHwnd(), msg.Get(), __LOCALIZE("S&M - Confirmation","sws_mbox"), MB_YESNO);
	}
	return r;
}
开发者ID:tweed,项目名称:sws,代码行数:15,代码来源:SnM_Project.cpp

示例13: ShowStartupActions

void ShowStartupActions(COMMAND_T* _ct)
{
	WDL_FastString msg(__LOCALIZE("No project startup action is defined","sws_startup_action"));
	if (int cmdId = SNM_NamedCommandLookup(g_prjActions.Get()->Get()))
		msg.SetFormatted(512, __LOCALIZE_VERFMT("'%s' is defined as project startup action", "sws_startup_action"), kbd_getTextFromCmd(cmdId, NULL));

	char prjFn[SNM_MAX_PATH] = "";
	EnumProjects(-1, prjFn, sizeof(prjFn));
	if (*prjFn)
	{
		msg.Append("\r\n");
		msg.AppendFormatted(SNM_MAX_PATH, __LOCALIZE_VERFMT("for %s", "sws_startup_action"), prjFn);
	}
	msg.Append(".");
	msg.Append("\r\n\r\n");

	if (int cmdId = SNM_NamedCommandLookup(g_globalAction.Get()))
	{
		msg.AppendFormatted(512, __LOCALIZE_VERFMT("'%s' is defined as global startup action", "sws_startup_action"), kbd_getTextFromCmd(cmdId, NULL));
	}
	else
	{
		msg.Append(__LOCALIZE("No global startup action is defined","sws_startup_action"));
	}
	msg.Append(".");

	MessageBox(GetMainHwnd(), msg.Get(), SWS_CMD_SHORTNAME(_ct), MB_OK);
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:28,代码来源:SnM_Project.cpp

示例14:

    const char *GetStringForIndex(EEL_F val, WDL_FastString **isWriteableAs=NULL)
    {
      int idx = (int) (val+0.5);
      if (idx>=0 && idx < MAX_USER_STRINGS)
      {
        if (isWriteableAs)
        {
          if (!m_rw_strings[idx]) m_rw_strings[idx] = new WDL_FastString;
          *isWriteableAs = m_rw_strings[idx];
        }
        return m_rw_strings[idx]?m_rw_strings[idx]->Get():"";
      }

      WDL_FastString *s = m_strings.Get(idx - STRING_INDEX_BASE);
      if (isWriteableAs) *isWriteableAs=s;
      return s ? s->Get() : NULL;
    }
开发者ID:robksawyer,项目名称:autotalent_64bit_osx,代码行数:17,代码来源:test.cpp

示例15: LICE_RGBA_FROMNATIVE

// split the text into lines and store them (not to do that in OnPaint()),
// empty lines are ignored
// _col: 0 to use the default theme text color
void SNM_DynSizedText::SetText(const char* _txt, int _col, unsigned char _alpha)
{ 
	if (m_col==_col && m_alpha==_alpha && !strcmp(m_lastText.Get(), _txt?_txt:""))
		return;

	m_lastText.Set(_txt?_txt:"");
	m_lines.Empty(true);
	m_maxLineIdx = -1;
	m_alpha = _alpha;
	m_col = _col ? LICE_RGBA_FROMNATIVE(_col, m_alpha) : 0;

	if (_txt && *_txt)
	{
		int maxLineLen=0, len;
		const char* p=_txt, *p2=NULL;
		while (p2 = FindFirstRN(p, true)) // \r or \n in any order (for OSX..)
		{
			if (len = (int)(p2-p))
			{
				if (len > maxLineLen) {
					maxLineLen = len;
					m_maxLineIdx = m_lines.GetSize();
				}

				WDL_FastString* line = new WDL_FastString;
				line->Append(p, len);
				m_lines.Add(line);
				p = p2+1;
			}

			while (*p && (*p == '\r' || *p == '\n')) p++;

			if (!*p) break;
		}
		if (p && *p && !p2)
		{
			WDL_FastString* s = new WDL_FastString(p);
			if (s->GetLength() > maxLineLen)
				m_maxLineIdx = m_lines.GetSize();
			m_lines.Add(s);
		}
	}
	m_lastFontH = -1; // will force font refresh
	RequestRedraw(NULL);
}
开发者ID:Breeder,项目名称:sws,代码行数:48,代码来源:SnM_VWnd.cpp


注:本文中的WDL_FastString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。