コード例 #1
0
ファイル: gdata.cpp プロジェクト: nsauzede/tartini
void GData::removeFileFromList(SoundFile *s)
{
  int j;
  int curPos;
  int prevPos;  
  //remove all the channels in s from the channels list
  for(j=0; j<s->numChannels(); j++) {
    Channel *c = s->channels(j);
    //if(c == getActiveChannel()) { setActiveChannel(NULL); }
    curPos = prevPos = 0;
    for(std::vector<Channel*>::iterator it1=channels.begin(); it1 != channels.end(); it1++, curPos++) {
      if((*it1) == c) {
        if(c == getActiveChannel()) prevPos = curPos;
        it1 = channels.erase(it1) - 1;
      }
    }
    if(channels.empty()) setActiveChannel(NULL);
    else setActiveChannel(channels.at(bound(prevPos, 0, int(channels.size()-1))));
  }
  //remove the soundFile from the soundFiles list
  for(std::vector<SoundFile*>::iterator it2=soundFiles.begin(); it2 != soundFiles.end(); it2++) {
    if((*it2) == s) {
      it2 = soundFiles.erase(it2) - 1;
    }
  }
  emit channelsChanged();
  //view->doSlowUpdate();
}
コード例 #2
0
ファイル: main.c プロジェクト: qermit/aprs-firmware
static void setupHardware(void) {
	SystemInit();
	SystemCoreClockUpdate();//CLKPWR_ConfigPPWR()
	//allPinsAsOut();
	//delay_ms(500);
	powerSectionInit();

#ifdef USE_MODULE_GSM
	GSM_Init();
#endif

	sensorControlInit();
	setActiveChannel(1);
#ifdef USE_MODULE_SENSORS
	//DS18B20_Init();
	initSHT21();
#endif

	//debugLed();
	//displayInitialization();
	//qtouchKeyboardInitialization();

#ifdef USE_MODULE_RTC
	initRTC();
#endif
}
コード例 #3
0
ファイル: ChannelSelector.cpp プロジェクト: yodor/arduino
void ChannelSelector::setPreviousChannel()
{
  int new_channel = current_channel-1;
  setActiveChannel((CHANNEL)new_channel);
}
コード例 #4
0
ファイル: ChannelSelector.cpp プロジェクト: yodor/arduino
void ChannelSelector::setNextChannel()
{
  int new_channel = current_channel+1;
  setActiveChannel((CHANNEL)new_channel);
}