Exemple #1
0
VcfGUI::VcfGUI(const std::string& URI)
{
	EventBox *p_background = manage(new EventBox());
	Gdk::Color* color = new  Gdk::Color();
	color->set_rgb(7710, 8738, 9252);
	p_background->modify_bg(Gtk::STATE_NORMAL, *color);



	VBox *p_mainWidget = manage(new VBox(false, 5));


	Label *p_labeFilterType = manage (new Label("Filter Type"));
	p_mainWidget->pack_start(*p_labeFilterType);

	m_comboVCFType = manage (new ComboBoxText());
	m_comboVCFType->append_text("Resonant Lowpass");
	m_comboVCFType->append_text("Lowpass");
	m_comboVCFType->append_text("Highpass");
	m_comboVCFType->append_text("Bandpass I");
	m_comboVCFType->append_text("Bandpass II");
	m_comboVCFType->append_text("Notch");
	m_comboVCFType->append_text("24dB Lowpass I");
	m_comboVCFType->append_text("24dB Lowpass II");

	slot<void> p_slotVCFType = compose(bind<0> (mem_fun(*this, &VcfGUI::write_control), p_vcfType), mem_fun(*m_comboVCFType, &ComboBoxText::get_active_row_number));
	m_comboVCFType->signal_changed().connect(p_slotVCFType);
	p_mainWidget->pack_start(*m_comboVCFType);



	slot<void> p_slotGain = compose(bind<0>(mem_fun(*this, &VcfGUI::write_control), p_inputGain), mem_fun(*this,  &VcfGUI::get_inputGain));
	m_scaleInputGain = new LabeledDial("Input Gain", p_slotGain, p_inputGain, 0, 10, LOG, 0.0001, 4);
	p_mainWidget->pack_start(*m_scaleInputGain);



	Frame *p_freqFrame = manage(new Frame("Frequency"));
	//p_gainFrame->set_shadow_type(Gtk::SHADOW_NONE);
	HBox *p_freqBox = manage(new HBox(true));

	slot<void> p_slotFrequency = compose(bind<0>(mem_fun(*this, &VcfGUI::write_control), p_freq), mem_fun(*this,  &VcfGUI::get_frequency));
	m_scaleFrequency = new LabeledDial("Frequency", p_slotFrequency, p_freq, 0, 10, LOG, 0.0001, 4);
	p_freqBox->pack_start(*m_scaleFrequency);

	slot<void> p_slotExpFMGain = compose(bind<0>(mem_fun(*this, &VcfGUI::write_control), p_expFMGain), mem_fun(*this,  &VcfGUI::get_expFMGain));
	m_scaleExpFMGain = new LabeledDial("Exp FM Gain", p_slotExpFMGain, p_expFMGain, 0, 10, LOG, 0.0001, 4);
	p_freqBox->pack_start(*m_scaleExpFMGain);

	slot<void> p_slotLinFMGain = compose(bind<0>(mem_fun(*this, &VcfGUI::write_control), p_linFMGain), mem_fun(*this,  &VcfGUI::get_linFMGain));
	m_scaleLinFMGain = new LabeledDial("Lin FM Gain", p_slotLinFMGain, p_linFMGain, 0, 10, LOG, 0.0001, 4);
	p_freqBox->pack_start(*m_scaleLinFMGain);

	p_freqFrame->add(*p_freqBox);
	p_mainWidget->pack_start(*p_freqFrame);



	Frame *p_resFrame = manage(new Frame("Resonance"));
	//p_gainFrame->set_shadow_type(Gtk::SHADOW_NONE);
	HBox *p_resBox = manage(new HBox(true));

	slot<void> p_slotResonance = compose(bind<0>(mem_fun(*this, &VcfGUI::write_control), p_resonance), mem_fun(*this,  &VcfGUI::get_resonance));
	m_scaleResonance = new LabeledDial("Resonance", p_slotResonance, p_resonance, 0.01, 1, LOG, 0.0001, 4);
	p_resBox->pack_start(*m_scaleResonance);

	slot<void> p_slotResonanceGain = compose(bind<0>(mem_fun(*this, &VcfGUI::write_control), p_resonanceGain), mem_fun(*this,  &VcfGUI::get_resonanceGain));
	m_scaleResonanceGain = new LabeledDial("Resonance Gain", p_slotResonanceGain, p_resonanceGain, 0, 1, LOG, 0.0001, 4);
	p_resBox->pack_start(*m_scaleResonanceGain);

	p_resFrame->add(*p_resBox);
	p_mainWidget->pack_start(*p_resFrame);



	p_mainWidget->set_size_request(180, 310);

	p_background->add(*p_mainWidget);
	add(*p_background);

	Gtk::manage(p_mainWidget);
}
Exemple #2
0
 void
 DbgCmd_Info::do_command(std::string &command_list)
 {
   do_command_by_category<DO_COMMAND>(command_list,
                                      mem_fun(this, &DbgCmd_Info::print_info_0arg));
 }
Exemple #3
0
 void
 DbgCmd_Info::do_help(std::string &command_list)
 {
   do_command_by_category<DO_HELP>(command_list,
                                   mem_fun(this, &DbgCmd_Info::print_help_0arg));
 }
Exemple #4
0
void DataFeed::Clear()
{
	for_each(channels.begin(), channels.end(), mem_fun(&DataChannel::reset));
}
Exemple #5
0
void DataFeed::AcquireSingleShot()
{
	for_each(channels.begin(), channels.end(), mem_fun(&DataChannel::AcquireSingleShot));
	for_each(channels.begin(), channels.end(), mem_fun(&DataChannel::AverageCurrentData));
}
Exemple #6
0
void DataFeed::AcquireNewData()
{
	for_each(channels.begin(), channels.end(), mem_fun(&DataChannel::AcquireNewData));
}
void Shop::browse_fullscreen(squadst& customers, int& buyer) const
{
   unsigned page = 0;

   std::vector<ShopOption*> available_options = options_;
   available_options.erase (remove_if (available_options.begin(),
				       available_options.end(),
				       not1 (mem_fun (&ShopOption::display))),
			    available_options.end());


   do
   {
      erase();
      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(0,0);
      addstr("What will ");
      addstr(customers.squad[buyer]->name);
      addstr(" buy?");
      move(1,0);
      addstr("----PRODUCT NAME-----------------------PRICE------------------------------------");
      int yline = 2;

      //Write wares and prices
      for(unsigned p = page * 19; p < available_options.size () && p < page * 19 + 19; p++)
      {
         if (available_options[p]->is_available())
            set_color(COLOR_WHITE,COLOR_BLACK,0);
         else
            set_color(COLOR_BLACK,COLOR_BLACK,1);
         move(yline,0);
         addch('A' + yline - 2);
         addstr(" - ");
         addstr(available_options[p]->get_description_fullscreen().c_str());
         ++yline;
      }

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(22,0);
      addstr("Press a Letter to select an option"); //allow customize "option"? -XML
      move(23,0);
      addpagestr();
      move(24,0);
      addstr(("Enter - " + std::string(customers.squad[buyer]->name) + " " + exit_).c_str());

      refresh();

      int c = getch();
      translategetch(c);

      //PAGE UP
      if ((c == interface_pgup || c == KEY_UP || c == KEY_LEFT) && page > 0)
         page--;
      //PAGE DOWN
      if ((c == interface_pgdn || c == KEY_DOWN || c == KEY_RIGHT)
          && (page + 1) * 19 < available_options.size())
         page++;

      if (c >= 'a' && c <= 's')
      {
         int p = page * 19 + static_cast<int>(c-'a');
         if (p < (int)available_options.size() && available_options[p]->is_available())
            available_options[p]->choose(customers, buyer);
         break;
      }

      if (c == 10)
         break;
   } while (true);
}
void Shop::browse_halfscreen(squadst& customers, int& buyer) const
{
   unsigned page = 0;
   const unsigned max_entries_per_page = 20;

   std::vector<ShopOption*> available_options = options_;

   available_options.erase (remove_if (available_options.begin(),
				       available_options.end(),
				       not1 (mem_fun (&ShopOption::display))),
			    available_options.end());

   int partysize = 0;
   for (int p = 0; p < 6; ++p)
   {
      if(customers.squad[p] != NULL)
      {
         partysize++;
      }
   }

   do
   {
      erase();
      set_color(COLOR_WHITE,COLOR_BLACK,0);

      locheader();
      printparty();

      move(8,45);
      addstr("Buyer: ");
      addstr(customers.squad[buyer]->name);

      //Write wares and prices
      int yline = 10;
      int column = 1;
      int taken_letters = 0;
      for (unsigned p = page * (max_entries_per_page - 1);
           p < available_options.size() && p < page * (max_entries_per_page - 1) + max_entries_per_page;
           ++p)
      {
         if (available_options[p]->is_available())
            set_color(COLOR_WHITE,COLOR_BLACK,0);
         else
            set_color(COLOR_BLACK,COLOR_BLACK,1);
         if (column == 1)
            move(yline,1);
         else
            move(yline,40);

         if (available_options[p]->letter_defined_)
            addch(available_options[p]->showletter());
         else
         {
            // Find an available letter to use for this ware.
            bool done = false;
            while (taken_letters < 27 && !done)
            {
               done = true;
               if ('a' + taken_letters == 'b' || // Letters used by the shop UI are disallowed.
                   'a' + taken_letters == 'e' ||
                   ('a' + taken_letters == 's' && allow_selling_) ||
                   ('a' + taken_letters == 'm' && sell_masks_))
               {
                  ++taken_letters;
                  done = false;
                  continue;
               }
               for (unsigned i = 0; i < available_options.size(); ++i)
               {
                  if (available_options[i]->letter_defined_ &&
                      'a' + taken_letters == available_options[i]->letter_)
                  {
                     ++taken_letters;
                     done = false;
                     break;
                  }
               }
            }
            available_options[p]->letter_ = 'a' + taken_letters;
            addch('A' + taken_letters);
            ++taken_letters;
         }

         addstr(" - ");
         addstr(available_options[p]->get_description_halfscreen().c_str());
         if (column == 1)
            column = 2;
         else
         {
            ++yline;
            column = 1;
         }
      }
      if (sell_masks_)
      {
         move(yline,1+(column-1)*39);
         if (ledger.get_funds() >= 15)
            set_color(COLOR_WHITE,COLOR_BLACK,0);
         else
            set_color(COLOR_BLACK,COLOR_BLACK,1);
         addstr("M - Buy a Mask                ($15)");
      }
      if (column == 2)
         ++yline;

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(yline,1);
      addstr("E - Look over Equipment");
      ++yline;

      if (allow_selling_)
      {
         move(yline,1);
         if (location[customers.squad[0]->base]->loot.size() > 0)
            set_color(COLOR_WHITE,COLOR_BLACK,0);
         else
            set_color(COLOR_BLACK,COLOR_BLACK,1);
         addstr("S - Sell something");
         ++yline;
      }

      ++yline;

      if (party_status != -1)
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(yline,1);
      addstr("0 - Show the squad's Liberal status");

      if (partysize > 0 && (party_status == -1 || partysize > 1))
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(yline++,40);
      addstr("# - Check the status of a squad Liberal");

      if (partysize >= 2)
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(yline,1);
      addstr("B - Choose a buyer");

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(yline,40);
      addstr("Enter - ");
      addstr(exit_.c_str());



      int c = getch();
      translategetch(c);

      for (unsigned i = 0; i < available_options.size(); ++i)
      {
         if (c == available_options[i]->letter_)
         {
            available_options[i]->choose(customers, buyer);
            break;
         }
      }

      if(c == 'e' && customers.squad[0]->base != -1)
         equip(location[customers.squad[0]->base]->loot, -1);
      else if (c == 's' && allow_selling_
               && location[customers.squad[0]->base]->loot.size() > 0)
         sell_loot(customers);
      else if (c == 'm' && sell_masks_ && ledger.get_funds() >= 15)
      {
         maskselect(*customers.squad[buyer]);
      }
      else if (c == 'b')
         choose_buyer(customers, buyer);
      else if (c == '0')
         party_status=-1;
      else if ( c >= '1' && c <= '6')
      {
         if (customers.squad[c-'1'] != NULL)
         {
            if (party_status == c - '1')
               fullstatus(party_status);
            else
               party_status = c - '1';
         }
      }
      else if (c == 10)
         break;

   } while (true);
}