예제 #1
0
    void onAlbEventStart(const QXmlAttributes& attrs)
    {
        string strDate (convStr(attrs.value("date")));
        if (!strDate.empty())
        {
            m_albumInfo.m_strReleased = m_albumInfo.m_strReleased.empty() ? strDate : min(m_albumInfo.m_strReleased, strDate);
        }

        string strFormat (convStr(attrs.value("format")));
        if (!strFormat.empty() && string::npos == m_albumInfo.m_strFormat.find(strFormat))
        {
            addIfMissing(m_albumInfo.m_strFormat, strFormat);
        }
    }
예제 #2
0
 void onAlbArtistNameChar(const string& s)
 {
     if (0 == convStr(s).compare("VaRiOuS Artists", Qt::CaseInsensitive))
     {
         m_albumInfo.m_eVarArtists = AlbumInfo::VA_VARIOUS;
     }
     else
     {
         m_albumInfo.m_strArtist = s;
     }
 }
예제 #3
0
 void onRelationStart(const QXmlAttributes& attrs)
 {
     if (m_bTargetIsUrl)
     {
         QString qstrType (attrs.value("type"));
         if ("AmazonAsin" == qstrType)
         {
             m_albumInfo.m_strAmazonLink = convStr(attrs.value("target"));
         }
         else if ("CoverArtLink" == qstrType)
         {
             string strUrl (convStr(attrs.value("target")));
             if (beginsWith(strUrl, "http://"))
             {
                 m_albumInfo.m_vstrImageNames.push_back(strUrl);
             }
             else
             { //ttt2 perhaps tell the user
                 qDebug("Unsupported image link");
             }
         }
     }
 }
예제 #4
0
파일: main.c 프로젝트: martinien/s6eep06
//////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                          //
//                                        Main function                                     //
//                                                                                          //
//////////////////////////////////////////////////////////////////////////////////////////////
int main(void)
{	//Test
	int last_nombre = 4;
	char str[64] = "Test de String...";
	unsigned char distanceActuel = 0;
	
	//Variables protocole de liaison de donnée
	char trame_a_envoye = 0, trame_complete = 0, trameRX[NBROCTET], trameTX[NBROCTET];
	
	//Initial configuration
	setup_oscillator();
	config();
	
	//Init fifo
	fifo_init();
	radio_dir(TRM_RX);		//Module en réception

	//Display welcome screen:	ToDo
	#ifdef USE_GLCD
	GLCD_Bitmap((char*)Base1, 0, 0, 128, 64);
	#endif
	

	
	//Test
//	index = 0;
//	while(1)
//	{
//	//	result = get_offset(dirty_buf[index], dirty_buf[index + 1], flag);
//		result = get_flag(flag);
//		Nop();
//		clean_buffer(result, 16);
//		Nop();
//	}
	
	//Main loop
	while (1)
	{

		#ifdef AUTO
		routine_auto(&trame_a_envoye, &trame_complete, trameTX, trameRX);
		#endif

		#ifdef BORNE
		routine_borne(&trame_a_envoye, &trame_complete, trameTX, trameRX);
		#endif
	
		
		//Test: encodeur et GLCD
		if((last_nombre != nombre) || buttonPress)	//Si une transition a eu lieu
		{
			#ifdef USE_GLCD
			
			GLCD_ClearScreen();
			GLCD_Bitmap((char*)Base1, 0, 0, 128, 64);
			if(buttonPress && !toEcran1)
			{
				BORNERESERVE = nombre;
				GLCD_GoTo(0,5);
				GLCD_WriteString(RESERVE);
				toEcran1 = 1;
			}
			else if(buttonPress && toEcran1)
			{
				toEcran1 = 0;
				BORNERESERVE = 3;
				confirm=2;
			}
			sprintf(str,"%d",SERIALBATTERIE);
			GLCD_GoTo(107,0);
			GLCD_WriteString(str);

			#endif
				switch(nombre)
				{
					case 0:
						#ifdef USE_GLCD
						DISTANCE = D1;
						GLCD_GoTo(0,2);
						GLCD_WriteString(ADR1A);
					if(!toEcran1)
					{
						GLCD_GoTo(0,3);
						GLCD_WriteString(ADR2);
						GLCD_GoTo(0,4);
						GLCD_WriteString(ADR3);
					}
						#endif
						break;
					case 1:
						#ifdef USE_GLCD
						DISTANCE = D2;
						GLCD_GoTo(0,3);
						GLCD_WriteString(ADR2A);
					if(!toEcran1)
					{
						GLCD_GoTo(0,2);
						GLCD_WriteString(ADR1);
						GLCD_GoTo(0,4);
						GLCD_WriteString(ADR3);
					}
						#endif
						break;
					case 2:
						#ifdef USE_GLCD
						DISTANCE = D3;
					if(!toEcran1)
					{
						GLCD_GoTo(0,2);
						GLCD_WriteString(ADR1);
						GLCD_GoTo(0,3);
						GLCD_WriteString(ADR2);
					}
						GLCD_GoTo(0,4);
						GLCD_WriteString(ADR3A);
						#endif
						break;
					default:
						#ifdef USE_GLCD
						GLCD_ClearScreen();
						GLCD_Bitmap((char*)Base1, 0, 0, 128, 64);
						#endif
						break;
				}
			#ifdef USE_GLCD
			
			GLCD_GoTo(90,7);
			GLCD_WriteString(METER);
			distanceActuel = DISTANCE;	
			buttonPress = 0;		
			last_nombre = nombre;
			if(confirm==2)
			{
				if(D1<DISTANCEPROCHE){
					borneProche(0);	
				}
				else if(D2<DISTANCEPROCHE){
					borneProche(1);
				}
				else if(D3<DISTANCEPROCHE){
					borneProche(2);
				}
				if(confirm==1)
				{
					buttonPress=1;
					toEcran1=0;
				}
				else if(confirm==0)
				{
					buttonPress=0;
					toEcran1=0;
					last_nombre=4;	
				}
			}
			#endif
		}	
		
		//Données sortantes
		if(trame_a_envoye == 1)
		{
			envoie = rf_envoie(trameTX, (char *)clean_buf);
			
			if(envoie == 1)
				trame_a_envoye = 0;
		}
		
		//Flags - Données entrantes	
		if(rf_flag == 1)//&& trame_complete == 0)
		{
			//Actualise la batterie
			#ifdef USE_GLCD
			getBatt();
			sprintf(str,"%03i",BATTERIE);			
			GLCD_GoTo(80,0);
			if(nombre==0)
			{DISTANCE = D1;}
			else if(nombre==1)
			{DISTANCE = D2;}
			else if(nombre==2)
			{DISTANCE = D3;}
			
			GLCD_WriteString(str);
			sprintf(str,"%i",DISTANCE);
			GLCD_GoTo(40,7);
			GLCD_WriteString(str);
			#endif

			result = get_flag(flag);
			if(result != 10)
			{
				clean_buffer(result, 32);

				//Extraction des octets vers la couche application
				trame_complete = rf_gerer_RX((char *)clean_buf, trameRX);			
			}
			
			//Remise à zéro de la détection
			rf_flag = 0;
			result = 10;
		}
		
		//
		
		#ifdef GPS_FEEDTHROUGH
		//TestGPS
		#ifdef DEBUG_MPSIM
			gps_flag =1;  //REMOVE
		#endif
		
		if(gps_flag)
		{
			gps_flag = 0;
			//Filtre les données quand le buffer est plein
			
			#ifdef DEBUG_MPSIM
				(gpsstr[3]='R'); //REMOVE
			#endif
			
			if((gpsstr[3]=='R'))
			{
				for(a =0;a<47;a++)
				{
					gps[a] = gpsstr[a]; //Buffer de travail
				}
			//	puts_usart1(gpsstr);
				//gps[] = "$GPRMC,174254.000,V,4522.75800,N,07155.43400,W";
				#ifdef DEBUG_MPSIM
					gps[20]='4';
					gps[21]='5';
					gps[22]='2';
					gps[23]='2';
					gps[25]='7';
					gps[26]='5';
					gps[27]='8';
					
					gps[33]='0';
					gps[34]='7';
					gps[35]='1';
					gps[36]='5';
					gps[37]='5';
					gps[39]='4';
					gps[40]='3';
					gps[41]='4';
					gps[45]='W';
				#endif
				convStr();
				
				//LaA = 45.3793;
				//LoA= -71.9239;
				
				assignDist(LaA,LoA);				
			}
		}
		#endif
/*
		#ifdef USE_GLCD

		if(buttonPress)
		{
			switchScreen(last_nombre);
			buttonPress = 0;
		}
		
		if(distanceActuel < DISTANCEBATT && BATTERIE < 50 && ecran ==2)
		{
			switchBatt();
		}
		#endif
*/
		
		if(buttonPress)
		{
			#ifdef BORNE
			buttonPress = 0;
			char donnee_test[NBROCTET] = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37};
			envoie = rf_envoie(donnee_test, (char *)clean_buf);
			#endif
			#ifdef AUTO
			puts_usart1(gps);
			#endif
		}
		
		
		
		if(rssi_flag)
		{
			rssi_flag = 0;
			//Filtre les données quand le buffer est plein
			rssi = get_rssi();
		}
		
	}
    return 0;
}
예제 #5
0
 void onRelStart(const QXmlAttributes& attrs)
 {
     m_dlg.m_vAlbums.push_back(MusicBrainzAlbumInfo());
     m_dlg.m_vAlbums.back().m_strId = convStr(attrs.value("id"));
 }
예제 #6
0
 void onRelStart(const QXmlAttributes& attrs)
 {
     CB_ASSERT (m_albumInfo.m_strId == convStr(attrs.value("id")));
 }