Example #1
0
char *MIDIrequestPortName(struct Tracker_Windows *window, ReqType reqtype, bool is_input){
  int num_ports;

  char **portnames=MIDI_getPortNames(&num_ports, is_input);
  vector_t v={0};
  int i;

#if defined(FOR_WINDOWS)
  if(num_ports==0)
    return NULL;
#endif

  for(i=0;i<num_ports;i++)
    VECTOR_push_back(&v,portnames[i]);

#if !defined(FOR_WINDOWS)
  VECTOR_push_back(&v,"Create new port");
#endif

  int sel=GFX_Menu(window,reqtype,"Select port",&v);
  if(sel==-1)
    return NULL;

  if(sel==num_ports){
    char *ret=NULL;
    while(ret==NULL)
      ret = GFX_GetString(NULL,reqtype,"Name: ");
    return ret;
  }

  return portnames[sel];
}
Example #2
0
static struct FX *selectFX(
	struct Tracker_Windows *window,
	struct WBlocks *wblock,
	struct WTracks *wtrack
){

  struct Tracks *track = wtrack->track;
  struct Patch *patch = track->patch;
  
  if(patch==NULL) {
    PATCH_select_patch_for_track(window,wtrack,true);
    //GFX_Message(NULL, "No instrument set for track %d\n",wtrack->l.num);
    return NULL;
  }
  
	struct FX *fx;
	int num_usedFX=getNumUsedFX(track);

	if(num_usedFX>0){
          int lokke;
          vector_t v={0};
          for(lokke=0;lokke<num_usedFX;lokke++)
            VECTOR_push_back(&v,getTrackFX(track,lokke)->name);

#if 0
          for(lokke=0;lokke<10000;lokke++)
            VECTOR_push_back(&v,talloc_format("extra %d",lokke));
#endif

          VECTOR_push_back(&v,"New FX");
          int selection=GFX_Menu(window,NULL,"Select FX",&v);
          if(selection==-1) return NULL;
          if(selection<num_usedFX) return getTrackFX(track,selection);
	}

	fx=talloc(sizeof(struct FX));

        fx->color = newFXColor();

        fx->patch = patch;
        
	if(
		patch->instrument->getFX(window,track,fx)
		==
		FX_FAILED
	){
		return NULL;
	}

        fx->slider_automation_value = OS_SLIDER_obtain_automation_value_pointer(patch,fx->effect_num);
        fx->slider_automation_color = OS_SLIDER_obtain_automation_color_pointer(patch,fx->effect_num);

	return fx;
}
Example #3
0
void Window_config(
	struct Tracker_Windows *window
){
	ReqType reqtype=GFX_OpenReq(window,30,12,"Window Config");

        vector_t v={0};
        VECTOR_push_back(&v,"Left Slider width");
        VECTOR_push_back(&v,"Bottom Slider height");
        VECTOR_push_back(&v, "First Beat Line color opacity");
        VECTOR_push_back(&v, "Beat Line color opacity");
        VECTOR_push_back(&v, "Line separate color opacity");
        //VECTOR_push_back(&v,"Minimum node-size");

	int sel=GFX_Menu(window,reqtype,"Select operation",&v);

	switch(sel){
		case -1: break;
#if 0
		case 0:
			SelectEditFont(window);
			break;
#endif
		case 0:
			SelectLeftSliderWidth(window,reqtype);
			break;
		case 1:
			SelectBottomSliderHeight(window,reqtype);
			break;
                case 2:
                        SetFirstBeatOpacity(window, reqtype);
                        break;
                case 3:
                        SetBeatOpacity(window, reqtype);
                        break;
                case 4:
                        SetLineOpacity(window, reqtype);
                        break;
#if 0
		case 5:
			SelectMinNodeSize(window,reqtype);
			break;
#endif
	}

	GFX_CloseReq(window,reqtype);

        if (sel != -1)
          Window_config(window);
}
Example #4
0
void Window_config(
	struct Tracker_Windows *window
){
	ReqType reqtype=GFX_OpenReq(window,30,12,"Select which variable to modify:");

        vector_t v={};
        int leftsliderwidth    = VECTOR_push_back(&v,"Left Slider width");
        int bottomsliderheight = VECTOR_push_back(&v,"Bottom Slider height");
        int firstbeat          = VECTOR_push_back(&v, "First Beat Line color opacity");
        int beatlineopacity    = VECTOR_push_back(&v, "Beat Line color opacity");
        int linecoloropacity   = VECTOR_push_back(&v, "Line separate color opacity");
        //VECTOR_push_back(&v,"Minimum node-size");

	int sel=GFX_Menu(window,reqtype,"",v,true);
        
#if 0
        // case 0:
        SelectEditFont(window);
        break;
#endif
        if (sel==leftsliderwidth)
          SelectLeftSliderWidth(window,reqtype);

        else if (sel==bottomsliderheight)
          SelectBottomSliderHeight(window,reqtype);

        else if (sel==firstbeat)
          SetFirstBeatOpacity(window, reqtype);

        else if (sel==beatlineopacity)
          SetBeatOpacity(window, reqtype);

        else if (sel==linecoloropacity)
          SetLineOpacity(window, reqtype);
        
#if 0
        else if (sel==selminnodesize)
          SelectMinNodeSize(window,reqtype);
#endif


	GFX_CloseReq(window,reqtype);

        if (sel != -1)
          Window_config(window);
}
Example #5
0
int popupMenu(const char *texts){
  struct Tracker_Windows *window=getWindowFromNum(-1);
  vector_t *vec = GFX_MenuParser(texts, "%");
  return GFX_Menu(window, NULL,"",vec);
}