Changes

Jump to: navigation, search

User:Scanff/Libwiiradio

1,209 bytes added, 04:47, 16 February 2010
Quickstart
void LWR_SetVolume(int);
 
</source>
 
Here's a quick example.
 
<source lang = "cpp">
char* tests[] = { "http://205.188.215.225:8002",
"http://scfire-dtc-aa07.stream.aol.com:80/stream/1040",
"http://208.76.152.74:8000"
};
 
 
 
int test_lib()
{
printf("\n\n\n\nTest libWiiRadio, will test three streams!\n");
 
for(int i = 0; i < 3;i++)
{
printf("Connecting to %s\n", tests[i]);
 
 
LWR_SetVolume(40*(i+1));
printf("setting volume %d\n", 40*(i+1));
 
if(LWR_Play(tests[i]) < 0)
{
printf("ERROR!\n");
LWR_Stop();
continue;
}
 
usleep(2000000); // wait till the info is grabbed
 
char *title = LWR_GetCurrentTrack();
if (title) printf("current track = %s\n", title);
 
int br = LWR_GetCurrentBitRate();
if (br != -1) printf("current bitrate = %d\n", br);
char* url = LWR_GetUrl();
if (url) printf("current url = %s\n", url);
int vol = LWR_GetVolume();
if (vol != -1) printf("current volume = %d\n", vol);
usleep(30000000); // play for a while
 
printf("Stop Playback!\n");
 
LWR_Stop();
}
 
printf("Test Done!\n");
 
return 0;
}
</source>
201
edits

Navigation menu