コード例 #1
0
void capture(const char *save_file_name, RawData &data, bool playback) {
    DAEPAnalysis ep;
    AutoCapture c(&ep);
    
    Tip("Press any key to capture:");
    getch();
    puts("");
    Tip("Preparing...");
    sleep(1);
    
    char fn_buffer [128]="";
    
    Tip("Start talking");

    if(c.capture(&data)) {
        data.saveWav(stringFile(save_file_name,".wav",fn_buffer));
        
        //if(playback)c.play(&data);
        
        ep.smooth();
        ep.cut();
        
        if(playback) c.play(&data);
        
        data.saveWav(stringFile(save_file_name,"_cut.wav",fn_buffer));
    }
    else{
        ErrorLog("Capture error");
    }
}
コード例 #2
0
ファイル: chain.cpp プロジェクト: 13971643458/qtum
CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const {
    int nStep = 1;
    std::vector<uint256> vHave;
    vHave.reserve(32);

    if (!pindex)
        pindex = Tip();
    while (pindex) {
        vHave.push_back(pindex->GetBlockHash());
        // Stop when we have added the genesis block.
        if (pindex->nHeight == 0)
            break;
        // Exponentially larger steps back, plus the genesis block.
        int nHeight = std::max(pindex->nHeight - nStep, 0);
        if (Contains(pindex)) {
            // Use O(1) CChain index if possible.
            pindex = (*this)[nHeight];
        } else {
            // Otherwise, use O(log n) skiplist.
            pindex = pindex->GetAncestor(nHeight);
        }
        if (vHave.size() > 10)
            nStep *= 2;
    }

    return CBlockLocator(vHave);
}
コード例 #3
0
ファイル: tipdatabase.cpp プロジェクト: skaarj37/tupi
Tip TipDatabase::tip() const
{
    if (k->currentTipIndex >= 0 && k->currentTipIndex < k->tips.count())
        return k->tips[k->currentTipIndex];

    return Tip();
}
コード例 #4
0
// BEAM BACKPTR PATH
void SeqModel::dtw(WaveFeatureOP & wav, SEQ_DTW_PATH_TYPE path_type) {
    setPathType(path_type);

    preparePathRecord(wav); 

    Dtw_Column_Link link[2];
    int idx;
    int wavSize = wav.size();
    int stateSiz = states.size();
    int start = Start_State;

    link[0].nodes = new Dtw_Column_Node[stateSiz];
    link[1].nodes = new Dtw_Column_Node[stateSiz];

    int columnIdx = -1;
    int rollIdx = getRollIdx(columnIdx);

    link[rollIdx].head = NIL_EDGE;

    link[rollIdx].nodes[start].cost = 0;
    link[rollIdx].addColumnNode(start);
    link[rollIdx].nodes[start].preIdx = NIL_BACK_PTR; // first backPtr is actually -1(don't exist)

    // forward start state to non-emit states if needed
    for(int eID = states[start].noEmitHead; eID != NIL_EDGE; eID = nonEmitEdges[eID].next) {
        int nextStateID = nonEmitEdges[eID].to;
        if(nextStateID == start) 
            continue;

        double nextCost = link[rollIdx].nodes[start].cost + nonEmitEdges[eID].cost;

        link[rollIdx].nodes[nextStateID].cost = nextCost;
        link[rollIdx].addColumnNode(nextStateID);
        link[rollIdx].nodes[nextStateID].preIdx = NIL_BACK_PTR; // first backPtr is actually -1(don't exist)
    }


    double bestVal = Feature::IllegalDist;

    for(columnIdx = 0; columnIdx < wavSize; columnIdx ++) {
//        Log(GREEN "Forwarding column [%d]\n", columnIdx);

        bestVal = forwardColumn(link, wav, columnIdx, bestVal + beamThr);

//        printf("%d %lf\n", columnIdx, bestVal);

//        Log("RED %lf", link[getRollIdx(columnIdx)].nodes[Terminal_States].cost);
        /*  
        if(link[getRollIdx(columnIdx)].nodes[7].lastUpdate == columnIdx)
            printf(RED "%d %d\n", columnIdx, link[getRollIdx(columnIdx)].nodes[7].preIdx);
            */
    }

    Tip(BLUE "Best Cost: %lf\n" , link[getRollIdx(wavSize - 1)].nodes[Terminal_States].cost);

    delete [] link[0].nodes;
    delete [] link[1].nodes;
}
コード例 #5
0
ファイル: Bottom.cpp プロジェクト: dreamsxin/ultimatepp
void RightTabs::MouseMove(Point p, dword)
{
	int c = GetPos(p);
	if(c != hl) {
		hl = c;
		Refresh();
		Tip(c >= 0 ? tab[c].tip : "");
	}
}
コード例 #6
0
ファイル: ToolButton.cpp プロジェクト: koz4k/soccer
void ToolButton::ResetKeepStyle()
{
	repeat = false;
	accel = 0;
	checked = false;
	NoWantFocus();
	minsize = Size(0, 0);
	maxiconsize = Size(INT_MAX, INT_MAX);
	Tip("");
	Help("");
	Topic("");
	Description("");
}
コード例 #7
0
ファイル: HeaderCtrl.cpp プロジェクト: AbdelghaniDr/mirror
void HeaderCtrl::MouseMove(Point p, dword keyflags) {
	if(isdrag) {
		ti = GetLastVisibleTab() + 1;
		for(int i = 0; i < GetCount(); i++)
			if(col[i].visible) {
				Rect r = GetTabRect(i).OffsetedHorz(-sb);
				if(p.x < r.left + r.Width() / 2) {
					ti = i;
					break;
				}
			}
		dragx = p.x;
		Refresh();
		return;
	}
	int q = GetSplit(p.x);
	int cx = ~q;
	if(cx >= 0 && cx < col.GetCount() && !IsNull(col[cx].tip))
		Tip(col[cx].tip);
	if(mode == FIXED)
		return;
	q = IsNull(q) || q >= 0 ? -1 : -1 - q;
	if(q != light)
		Refresh();
	if(!HasCapture())
		return;
	Size sz = GetSize();
	int x = mode == SCROLL ? p.x + sb : min(sz.cx, p.x);
	if(split >= 0) {
		int w = x - colRect.left;
		if(w < 0) w = 0;
		if(w != GetTabWidth(split)) {
			SetTabWidth0(split, w);
			Refresh();
			if(track) {
				Sync();
				Action();
				WhenLayout();
			}
		}
	}
}
コード例 #8
0
ファイル: TipsDialog.cpp プロジェクト: cgmb/renderdoc
void TipsDialog::initialize()
{
  ///////////////////////////////////////////////////////////
  // This section of code is auto-generated. Modifications //
  // will be lost if made by hand.                         //
  //                                                       //
  // If you have a tip you'd like to add, email it to me   //
  // or open an issue on github to suggest it.             //
  ///////////////////////////////////////////////////////////

  // Tip 1
  m_tips.push_back(
      Tip(tr("Talk to me!"),
          tr("RenderDoc is a labour of love and has been developed from scratch entirely in my "
             "spare time. If you run into a bug, have a feature request or just have a question, "
             "please feel free to get in touch and I'm always happy to talk and help out in any "
             "way I can - [email protected].")));

  // Tip 2
  m_tips.push_back(Tip(tr("Quick channel toggling"),
                       tr("Right clicking on a channel button in the texture viewer will select it "
                          "alone. If it is already the only channel selected, the meaning is "
                          "inverted and all others will be selected.\n\nThis is most useful for "
                          "quickly toggling between RGB and Alpha-only views.")));

  // Tip 3
  m_tips.push_back(
      Tip(tr("Quick range autofitting"),
          tr("The magic wand auto-fitting button in the texture viewer automatically calculates "
             "the min and max values of any visible channel in the texture, and rescales the "
             "visible range to include them.\n\nIf you right click on it, it will toggle on a mode "
             "to automatically rescale every time the viewed texture changes.\n")));

  // Tip 4
  m_tips.push_back(
      Tip(tr("Choosing mesh elements to visualise"),
          tr("In the mesh output pane, you can right click on any of the element columns to select "
             "that element as either position or secondary property to render. This way you can "
             "view a mesh in UV space, or visualise normals.")));

  // Tip 5
  m_tips.push_back(Tip(tr("Visualising secondary mesh properties"),
                       tr("In the mesh output pane, you can select an element as 'secondary', and "
                          "in the solid shading dropdown choosing secondary will display the "
                          "element as RGB colour on top of the mesh.")));

  // Tip 6
  m_tips.push_back(
      Tip(tr("Register highlighting in the shader debugger"),
          tr("While debugging a shader, clicking on a register or constant buffer variable in the "
             "disassembly will highlight all other uses of that register or variable in the "
             "disassembly. It will also highlight the matching row in the watch windows.")));

  // Tip 7
  m_tips.push_back(
      Tip(tr("Shader register value display"),
          tr("If you want to see to see a register reinterpreted as different types, you can hover "
             "over it either in the disassembly or in the watch windows. A tooltip will show it "
             "interpreted as float, uint decimal, int decimal or hexadecimal.")));

  // Tip 8
  m_tips.push_back(
      Tip(tr("Custom shader watch expressions"),
          tr("In addition to the pre-filled watch windows while shader debugging, you can also "
             "enter custom watch expressions. This takes the form of e.g. r0.xyz. You can append "
             ",x or ,b to specify the type - full list in the docs.\n")));

  // Tip 9
  m_tips.push_back(Tip(tr("Shader debugger float/int toggle"),
                       tr("By default register values are shown as floats, but you can toggle this "
                          "to default to ints either in the shader debugger toolbar, or by right "
                          "clicking and toggling int/float display.\n")));

  // Tip 10
  m_tips.push_back(Tip(tr("D3D11 shader debug information"),
                       tr("You'll get the best results in RenderDoc by stripping as little as "
                          "possible from D3D11 shaders. Reflection data is used all over the place "
                          "to produce a nicer debugging experience.\n")));

  // Tip 11
  m_tips.push_back(
      Tip(tr("Shader editing & Replacement"),
          tr("RenderDoc has the ability to edit and replace shaders and see the results live in "
             "the replay. On the pipeline state view, click the edit icon next to the shader. If "
             "source is available, it will be compiled, otherwise an empty stub with resources "
             "will be generated.\n\nThe shader will be replaced everywhere it is used in the "
             "frame, the original will be restored when the edit window is closed.\n")));

  // Tip 12
  m_tips.push_back(
      Tip(tr("Linear/Gamma display of textures"),
          tr("RenderDoc interprets all textures in gamma space - even if the data is linear such "
             "as a normal map. This is by convention, since typically external image viewers will "
             "display a normal map as gamma data. This can be overridden by toggling the gamma "
             "button in the texture viewer.\n")));

  // Tip 13
  m_tips.push_back(
      Tip(tr("Seeing texture usage in a capture"),
          tr("RenderDoc has a list of how each texture is bound and used - whether as a shader "
             "resource, an output target, or a copy source. When the texture is active in the "
             "texture viewer this usage will be displayed on the timeline bar at the top.\n\nYou "
             "can also right click on the thumbnails in the texture viewer to see a list of this "
             "usage, and clicking any entry will jump to that event.\n")));

  // Tip 14
  m_tips.push_back(
      Tip(tr("Custom buffer formatting"),
          tr("When opening a raw view of a buffer, such as a vertex buffer or compute read/write "
             "buffer resource, you can apply custom formatting to it to dictate the layout of the "
             "elements in typical shader syntax.\n\nThis formatting is also available for constant "
             "buffers to override the layout reflected from the shader.\n")));

  // Tip 15
  m_tips.push_back(
      Tip(tr("Pipeline HTML export"),
          tr("The pipeline view contains an HTML export function, which dumps the raw state of the "
             "entire pipeline out to a specified file. This can be useful for comparison between "
             "two events, or for having all information available in a unified text format.\n")));

  // Tip 16
  m_tips.push_back(Tip(tr("Python scripting"),
                       tr("RenderDoc supports some amount of Python scripting. Open up the Python "
                          "shell in the UI to either use it interactively or load and execute "
                          "python scripts.\n\nThe 'renderdoc' object is an instance of the Core "
                          "class - see the RenderDoc source for more information.")));

  // Tip 17
  m_tips.push_back(Tip(
      tr("Pixel history view"),
      tr("RenderDoc supports a pixel history view, showing the list of all modification events "
         "that happened to a specified pixel. To launch it, simply pick the pixel you would like "
         "to view the history of in the texture viewer, and click the 'history' button underneath "
         "the zoomed-in pixel context.\n\nEach event will show up red or green depending on "
         "whether it affected or didn't affect the pixel. By expanding the event, you can see the "
         "possibly several primitives within the draw that overdrew the pixel.\n")));

  // Tip 18
  m_tips.push_back(
      Tip(tr("List of active textures"),
          tr("On the texture viewer, the texture list button under the 'Actions' section will open "
             "a filterable list of all texture resources. Clicking on any of the entries will open "
             "a locked tab of that texture, always showing the contents of the texture at the "
             "current event regardless of whether or not it is bound to the pipeline.\n")));

  // Tip 19
  m_tips.push_back(Tip(
      tr("Locked texture tabs"),
      tr("You can open a locked texture tab from the texture list, or by right or double clicking "
         "on a texture's thumbnail.\n\nWith a locked tab of a texture, that tab will always show "
         "that texture, regardless of what is bound to the pipeline. This way you can track the "
         "updates of a texture through binds and unbinds, e.g. ping-pong rendertarget use.\n")));

  // Tip 20
  m_tips.push_back(
      Tip(tr("Gathering of per-event callstacks"),
          tr("RenderDoc is able to gather callstacks either per-drawcall or per-API event. You can "
             "do this by enabling the option before launching an application capture.\n\nWhen "
             "loading the log, initially the callstacks will not be available until symbols are "
             "resolved. Go to tools -> resolve symbols to load up the pdbs matching the modules "
             "from the application.\n")));

  // Tip 21
  m_tips.push_back(Tip(
      tr("Texture debugging overlays"),
      tr("In the texture viewer, you can select from several helpful debugging overlays over the "
         "current view. This can show wireframe or solid coloour overlays of the current drawcall, "
         "as well as showing depth pass/fail or even representing quad overdraw as a heatmap.\n")));

  // Tip 22
  m_tips.push_back(
      Tip(tr("Custom texture display shaders"),
          tr("RenderDoc supports writing custom shaders to decode the viewed texture, which can be "
             "useful to e.g. colourise stencil values or decode a packed gbuffer texture.\n\nIn "
             "the toolbar in the texture viewer, select custom instead of RGBA on the left side, "
             "and use the UI to create a new shader. The docs contain full listings of available "
             "constants and resources to bind.\n")));

  // Tip 23
  m_tips.push_back(
      Tip(tr("Texture histogram"),
          tr("RenderDoc can display a channel histogram showing the distribution of values within "
             "the visible range. Simply click the graph button on the texture viewer to the right "
             "of the range control, and it will expand to show the histogram.\n")));

  // Tip 24
  m_tips.push_back(
      Tip(tr("Attaching to a running instance"),
          tr("If you have launched a program via RenderDoc or your program integrates RenderDoc, "
             "the UI can connect to it once it is running via File -> Attach to Running Instance, "
             "and everything works as if you had launched it.\n\nYou can even do this across a "
             "network, by adding a remote IP or hostname. You will connect over the network and "
             "can remotely trigger captures - any files will be copied back across the network, to "
             "be saved and replayed locally as normal.\n")));

  // Tip 25
  m_tips.push_back(
      Tip(tr("Event browser bookmarks"),
          tr("In the event browser you can bookmark useful events by clicking the asterisk. This "
             "can let you quickly jump back and forth through the log between important "
             "points.\n\nWhen you have some bookmarks, shortcut buttons will appear in a small bar "
             "at the top of the browser, and the shortcut keys Ctrl-1 through Ctrl-0 jump to the "
             "first 10 bookmarks - these shortcuts are global regardless of which RenderDoc window "
             "is currently in focus.\n")));

  // Tip 26
  m_tips.push_back(
      Tip(tr("Mousewheel for scrolling"),
          tr("Anywhere you need to use the mousewheel to scroll, it will work simply by hovering "
             "over the panel and scrolling, no need to click to change focus.\n")));

  // Tip 27
  m_tips.push_back(
      Tip(tr("Event browser keyboard shortcuts"),
          tr("In the event browser Ctrl-F opens up the find bar, to locate an event by its name. "
             "Ctrl-G opens the jump-to-event to jump to the closest drawcall to a numbered event. "
             "Ctrl-B will toggle a bookmark at the current event.\n")));

  // Tip 28
  m_tips.push_back(
      Tip(tr("Mesh VS Output camera settings"),
          tr("The VS Output pane in the mesh output window will attempt to guess your projection "
             "matrix to unproject the vertices into camera space. It assumes a perspective "
             "projection and guesses the near and far planes, and matches the aspect ratio to the "
             "current output target.\n\nIf these parameters are incorrect - e.g. you are using an "
             "orthographic projection or the near/far guesses are wrong, you can override them by "
             "opening the view settings with the cog icon.\n")));

  // Tip 29
  m_tips.push_back(
      Tip(tr("Global process hook"),
          tr("Sometimes a particular program is difficult to launch directly through RenderDoc. In "
             "these cases, RenderDoc can install a global system hook that will insert a tiny shim "
             "DLL into every newly-created process on the system. This shim will identify if it is "
             "in the target application and either inject RenderDoc, or unload itself.\n\nNote: "
             "Since it is a global hook this is not without risks, only use if it's the only "
             "alternative, and read the documentation carefully.\n")));

  ///////////////////////////////////////////////////////////
  // This section of code is auto-generated. Modifications //
  // will be lost if made by hand.                         //
  //                                                       //
  // If you have a tip you'd like to add, email it to me   //
  // or open an issue on github to suggest it.             //
  ///////////////////////////////////////////////////////////
}